{"record":{"id":"89ad9db38e0f8925","repo":"xai-org/x-algorithm","slug":"compiler-annotation-file-file-path-not-found","errorCode":null,"errorMessage":"Compiler annotation file {file_path} not found.","messagePattern":"Compiler annotation file (.+?) not found\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/utils/aot.py","lineNumber":312,"sourceCode":"\n\ndef _lowered_name(lowered: Lowered):\n    sym_name = lowered.compiler_ir(dialect=\"stablehlo\").operation.attributes[\"sym_name\"]\n    return ir.StringAttr(sym_name).value\n\n\n@dataclass(frozen=True)\nclass HashContext:\n    hlo: str\n    args_info: str\n    environment: str\n    additional_content: str = None\n\n\ndef read_annotation_file(file_path: str) -> str:\n    p = Path(file_path)\n    if not p.exists():\n        raise FileNotFoundError(f\"Compiler annotation file {file_path} not found.\")\n    with p.open(\"r\") as f:\n        return f.read()\n\n\ndef get_sanitized_ir_text(lowered: Lowered, add_loc: bool) -> str:\n    module = lowered.compiler_ir(dialect=\"stablehlo\")\n    with module.context:\n        sanitized = _remove_callbacks(module.operation.clone(), IgnoreCallbacks.ALL)\n        return sanitized.operation.get_asm(enable_debug_info=add_loc)\n\n\ndef get_environment_info() -> str:\n    backend = get_backend()\n    device_kinds = \",\".join(sorted({d.device_kind for d in backend.devices()}))\n    return \"\\n\".join(\n        [\n            f\"jax={jax.version.__version__}\",\n            f\"jaxlib={jaxlib_version_str}\",","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/utils/aot.py#L294-L330","documentation":"read_annotation_file wraps Path.open to give a clear error when a requested XLA/compiler annotation file (e.g. HLO dump for tuning) does not exist on disk. It is a friendly re-raise of a missing-file condition before reading.","triggerScenarios":"Passing a compiler annotation path (from config or _compile_or_load) that doesn't exist: wrong path, file deleted after compile, or path on a node without the shared filesystem mount.","commonSituations":"HLO dumps referenced by absolute paths not present on other machines; job restarted after /tmp cleanup; typo in the annotation path config.","solutions":["Verify the path exists and is readable before calling (Path(p).exists())","Use paths on a shared filesystem consistent across nodes","Regenerate the annotation/dump if it was cleaned up"],"exampleFix":"# before\ncontent = read_annotation_file(\"/tmp/hlos/0/module_0000.txt\")\n# after\nfrom pathlib import Path\np = \"tmp/hlos/0/module_0000.txt\"\ncontent = read_annotation_file(p) if Path(p).exists() else \"\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\nif not Path(annotation_path).exists():\n    content = ''  # or regenerate\nelse:\n    content = read_annotation_file(annotation_path)","typeGuard":null,"tryCatchPattern":"try:\n    content = read_annotation_file(p)\nexcept FileNotFoundError:\n    logger.warning('annotation missing: %s', p)\n    content = ''","preventionTips":["Keep annotation dumps on shared storage referenced by stable paths","Existence-check before reading in job scripts","Avoid absolute /tmp paths in multi-node jobs"],"tags":["file-not-found","compiler-annotations","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}