Skip to content

Commit dad0682

Browse files
authored
chore: rename FLASHINFER_JIT_VERBOSE to FLASHINFER_JIT_DEBUG for clarity (#1946)
<!-- .github/pull_request_template.md --> ## 📌 Description Rename environment variable `FLASHINFER_JIT_VERBOSE` to `FLASHINFER_JIT_DEBUG` to better reflect its actual behavior. - `FLASHINFER_JIT_DEBUG`: Enable debug mode during compilation (disable optimization, add debug symbols) - The previous name `FLASHINFER_JIT_VERBOSE` implied "showing more compilation info", which was confusing - Maintained backward compatibility: falls back to `FLASHINFER_JIT_VERBOSE` if `FLASHINFER_JIT_DEBUG` is not set ## 🔍 Related Issues <!-- Link any related issues here --> ## 🚀 Pull Request Checklist Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete. ### ✅ Pre-commit Checks - [x] I have installed `pre-commit` by running `pip install pre-commit` (or used your preferred method). - [x] I have installed the hooks with `pre-commit install`. - [x] I have run the hooks manually with `pre-commit run --all-files` and fixed any reported issues. > If you are unsure about how to set up `pre-commit`, see [the pre-commit documentation](https://pre-commit.com/). ## 🧪 Tests - [x] Tests have been added or updated as needed. - [ ] All tests are passing (`unittest`, etc.). ## Reviewer Notes <!-- Optional: anything you'd like reviewers to focus on, concerns, etc. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Introduced FLASHINFER_JIT_DEBUG environment variable for controlling JIT debug builds with backward compatibility for legacy FLASHINFER_JIT_VERBOSE. * Enhanced debug build configuration with improved compiler and CUDA debugging flags. Non-debug builds continue using -O3 optimizations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d84e1d5 commit dad0682

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

flashinfer/jit/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,10 @@ def gen_jit_spec(
290290
needs_device_linking: bool = False,
291291
) -> JitSpec:
292292
check_cuda_arch()
293-
verbose = os.environ.get("FLASHINFER_JIT_VERBOSE", "0") == "1"
293+
# Use FLASHINFER_JIT_DEBUG if set, otherwise use FLASHINFER_JIT_VERBOSE (for backward compatibility)
294+
debug_env = os.environ.get("FLASHINFER_JIT_DEBUG")
295+
verbose_env = os.environ.get("FLASHINFER_JIT_VERBOSE", "0")
296+
debug = (debug_env if debug_env is not None else verbose_env) == "1"
294297

295298
cflags = ["-std=c++17", "-Wno-switch-bool"]
296299
cuda_cflags = [
@@ -302,15 +305,14 @@ def gen_jit_spec(
302305
"-DFLASHINFER_ENABLE_FP8_E4M3",
303306
"-DFLASHINFER_ENABLE_FP8_E5M2",
304307
]
305-
if verbose:
308+
if debug:
306309
cflags += ["-O0", "-g"]
307310
cuda_cflags += [
308311
"-g",
309312
"-O0",
310313
"-G",
311314
"-lineinfo",
312315
"--ptxas-options=-v",
313-
"--ptxas-options=--verbose,--register-usage-level=10,--warn-on-local-memory-usage",
314316
"-DCUTLASS_DEBUG_TRACE_LEVEL=2",
315317
]
316318
else:

0 commit comments

Comments
 (0)