Skip to content

Commit 77ccda8

Browse files
authored
misc: Use environment variable to control JIT verbose flag (#981)
If `FLASHINFER_JIT_VERBOSE=1`, flashinfer JIT compilation will: * Print verbose output (register usage, etc). * Set `lineinfo` for using [compute-sanitizer](https://docs.nvidia.com/compute-sanitizer/ComputeSanitizer/index.html)
1 parent 3a69560 commit 77ccda8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

flashinfer/jit/core.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def load_cuda_ops(
8787
extra_cuda_cflags: Optional[List[str]] = None,
8888
extra_ldflags=None,
8989
extra_include_paths=None,
90-
verbose=False,
9190
):
91+
verbose = os.environ.get("FLASHINFER_JIT_VERBOSE", "0") == "1"
92+
9293
if extra_cflags is None:
9394
extra_cflags = []
9495
if extra_cuda_cflags is None:
@@ -106,6 +107,14 @@ def load_cuda_ops(
106107
"-DFLASHINFER_ENABLE_FP8_E4M3",
107108
"-DFLASHINFER_ENABLE_FP8_E5M2",
108109
]
110+
if verbose:
111+
cuda_cflags += [
112+
"-g",
113+
"-lineinfo",
114+
"--ptxas-options=-v",
115+
"--ptxas-options=--verbose,--register-usage-level=10,--warn-on-local-memory-usage",
116+
]
117+
109118
cflags += extra_cflags
110119
cuda_cflags += extra_cuda_cflags
111120
logger.info(f"Loading JIT ops: {name}")

0 commit comments

Comments
 (0)