Skip to content

Commit 7a25c5f

Browse files
fsx950223claude
andcommitted
fix(compile): opt in to -asm-verbose explicitly; restore get_occupancy
The companion LLVM patch (ROCm/llvm-project#3177) now makes ROCDL's AsmVerbose an opt-in via `-asm-verbose` in gpu-module-to-binary's `opts` argument rather than always-on, so pass it explicitly from _dump_isa. Also restores flydsl.utils.kernel_info.get_occupancy(), which was dropped from the previous commit by an editing mishap despite still being imported by tests/unit/test_kernel_info.py. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 0f9ebfc commit 7a25c5f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

python/flydsl/compiler/jit_function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,9 @@ def _dump_isa(*, dump_dir: Path, ctx: ir.Context, asm: str, verify: bool, stage_
686686
di_pass = (
687687
"ensure-debug-info-scope-on-llvm-func{emission-kind=LineTablesOnly}," if env.debug.enable_debug_info else ""
688688
)
689+
cmd_opts = "-asm-verbose" + (" -g" if env.debug.enable_debug_info else "")
689690
pm = PassManager.parse(
690-
f'builtin.module({di_pass}gpu-module-to-binary{{format=isa opts="{"-g" if env.debug.enable_debug_info else ""}" section= toolkit=}})',
691+
f'builtin.module({di_pass}gpu-module-to-binary{{format=isa opts="{cmd_opts}" section= toolkit=}})',
691692
context=ctx,
692693
)
693694
pm.enable_verifier(bool(verify))

python/flydsl/utils/kernel_info.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
re-derive occupancy/register usage from device properties themselves.
2222
"""
2323

24-
from typing import Dict
24+
from typing import Dict, Optional
2525

2626
KERNEL_INFO_HEADER = "; Kernel info:"
2727

@@ -48,3 +48,9 @@ def parse_kernel_info(isa_text: str) -> Dict[str, str]:
4848
key, _, value = line.partition(":")
4949
info[key.strip()] = value.strip()
5050
return info
51+
52+
53+
def get_occupancy(isa_text: str) -> Optional[int]:
54+
"""Convenience accessor for the ``Occupancy`` field, as an int."""
55+
value = parse_kernel_info(isa_text).get("Occupancy")
56+
return int(value) if value is not None else None

0 commit comments

Comments
 (0)