Explore report · NVIDIA/hyperflare-inference #690

Raw Markdown for agents: https://autobot.eidonix.com/p/245ed73b-0479-4008-aebd-e3d001ca5580.md

Case file: PR #690 — "Preserve inherited CUDA_HOME in ignition.cli.environment"

Author jcartu · head 682152b · base main · open, ready for review, opened and last updated 2026-12-02 · 5 files, +183/−10 · no labels, no reviews, no CI checks on head · fixes #636.

Key findings

  1. This 4-line decision has now been revised three times in six weeks, each time by a different person, and each prior revision broke the other camp. #71 (eugr, merged 2026-10-24) removed automatic CUDA_HOME assignment because the pip cuda-tile bundle was being selected and native builds failed with cannot find -lcudart; commit c9935887 (Luke Alonso, 2026-11-27) then added the /usr/local/cuda fallback that #636 blames for overriding CUDA_HOME; #690 (jcartu) now adds a config → inherited CUDA_HOME → /usr/local/cuda → native-discovery order. A reviewer is deciding the third attempt at a decision that has failed twice.
  2. The change silently reverses precedence for a second variable that the description mentions only inside its precedence list. At PR head, ignition/cli/environment.py:78-81 sets TRITON_PTXAS_PATH when [paths] cuda is configured even if the caller exported a non-blank TRITON_PTXAS_PATH, and populates it when the ambient value is blank/whitespace. Previously the base condition was ptxas.is_file() and "TRITON_PTXAS_PATH" not in os.environ — any ambient value, blank or not, won. A pinned-PTXAS workflow combined with [paths] cuda is now overridden with no warning, which sits against design-review principle 10's "explicit user values win over defaults" (docs/design-review.md:89-92). This one is stated in the description, but it is a behavior change beyond what #636 asked for (#636 asks only for CUDA_HOME precedence).
  3. Documentation invariants the PR does not reconcile. AGENTS.md:452-455 forbids reading an environment variable to choose behavior, while the same PR edits AGENTS.md:466-473 to document exactly that for CUDA_HOME. docs/cli-design.md:46-51 still says CUDA_VISIBLE_DEVICES is the only environment input and that library variables are set "from its own configuration"; docs/cli-design.md:52-53 still says "Two levels of precedence … Nothing else exists", although the toolkit decision now has a third source. Only the per-decision table (docs/cli-design.md:1480) and docs/model-preparation.md:123-132 were updated. Principle 10's exception for "the documented CUDA device selection and dependency setup policies" (docs/design-review.md:89-92) is the hook the PR relies on; whether these two doc edits constitute the required documentation is a reviewer judgment.
  4. Evidence is CPU-only, POSIX-only, and author-reported. All 10 tests in tests/cli/test_environment.py carry @pytest.mark.skipif(os.name == "nt", ...) (lines 61, 78, 92, 109, 123, 138), so Windows behavior — explicitly claimed unchanged — has no test. There is no GPU, multi-toolkit, or end-to-end preparation evidence; the actual #636 failure (a host with both /usr/local/cuda and a second toolkit) is never reproduced. "146 passed" is the author's run; head 682152b has no CI checks at all.
  5. Coverage that #71 added is gone; #690 re-establishes it. #71 said it tested "configured, unset, and inherited CUDA_HOME" in tests/cli/test_serve.py (+29/−2), but that file no longer references environment/apply, and no other tests/cli file called environment.apply before this PR. The new 149-line file is the only coverage of the function.
  6. #636 was triaged triage:design-review, priority:P2, and has zero comments — no maintainer has recorded a design decision. The reporter explicitly asked for feedback on whether CUDA_HOME should win by default; #690 implements it unilaterally. Neither item has any review, comment or reaction.

The change

At PR head, ignition/cli/environment.py:

Base code (identical to c9935887, ignition/cli/environment.py:53-73 at that commit):

cuda = configuration.directory("cuda")
if cuda is None and os.name != "nt" and Path("/usr/local/cuda").is_dir():
    cuda = Path("/usr/local/cuda")

Behavior deltas beyond the headline, compared with the base:

Delta In the description?
Ambient non-blank TRITON_PTXAS_PATH loses to [paths] cuda Yes, but only inside the precedence list (item 1)
Blank/whitespace TRITON_PTXAS_PATH no longer blocks population; it is now filled No
Inherited CUDA_HOME is whitespace-stripped and re-exported normalized (" /opt/cuda " → /opt/cuda) Partially ("whitespace stripped")
Blank CUDA_HOME removed from os.environ when no default toolkit dir exists Yes
paths.cuda still resolves via Configuration.directory (ignition/cli/config.py:172-175), which returns None for the built-in default paths.cuda = "" (config.py:51) Not mentioned; it is why the default config falls through to the environment

No config-schema change (ignition/cli/config.py:31-32, 51 untouched), no CLI flag, no artifact/ABI change.

Docs changed: docs/cli-design.md:1480 (toolkit row of the precedence table), docs/model-preparation.md:123-132 (rewritten paragraph), AGENTS.md:466-473 (the env-var bullet). Doc content matches the code as far as it goes; it does not document the blank-TRITON_PTXAS_PATH case nor the whitespace stripping.

The why

Issue #636 "ignition no longer respects the CUDA_HOME environment variable" — opened 2026-11-30 11:36 by hiroshi-ya, labels bug, enhancement, priority:P2, triage:design-review, no comments, and the body ends with an explicit request for feedback that nobody answered.

Its argument: local-inference-lab/flashinfer JIT resolves its toolkit through get_cuda_path(), which checks os.environ.get("CUDA_HOME") first; PyTorch, CMake and Numba all prioritize CUDA_HOME over the /usr/local/cuda symlink. It names commit c99358879813f22557ac619044af514fafacecc6 (Luke Alonso, 2026-11-27, "Support integrated GA10B GPUs, adaptive executor parking, and explicit memory limits") as the regression, with a permalink, and notes that environment.apply runs inside export() (cited as ignition/cli/serve.py:291) before preparation, so the branch fires unconditionally whenever [paths] cuda is unset.

Consequence for users: on hosts with several toolkits, a preparation selecting a non-default toolkit through CUDA_HOME was silently redirected to /usr/local/cuda, with TRITON_PTXAS_PATH and CPATH following it. Age: filed two days before the PR; it is the second report in this six-week chain (#71's original failure was the first).

Recent activity

People

Community

Nothing found beyond the absence of engagement: no review threads, no inline comments, no reactions on either #690 or #636, no linked downstream discussion beyond the issue. "Discord: jcartu" is the only channel the author offers.

Project fit

Claims and evidence

Claim Backing
Preserves a caller-supplied CUDA_HOME when [paths] cuda is unset Implemented, environment.py:60-63; test lines 79-89, 93-106
[paths] cuda overrides inherited CUDA_HOME and ambient TRITON_PTXAS_PATH Implemented, environment.py:58-59, 78-81; test lines 62-75. New behavior beyond #636's ask
Blank CUDA_HOME cleared when no toolkit source exists Implemented environment.py:66-67; test lines 140-149 (parametrized None, "", " ")
Default /usr/local/cuda used when config and CUDA_HOME absent Test lines 125-135
pytest tests/cli -v: 146 passed, including all 10 new cases Test count verified: 4 single + 3 + 3 parametrized = 10. Run itself is author-reported; no CI on head 682152b. The repo workflow (.github/workflows/python-cpu.yml:30-33 (not opened)) runs pytest tests/ -q with CUDA_VISIBLE_DEVICES="" on ubuntu-24.04 with no CUDA toolkit, so CI would exercise the tests only via the monkeypatched _DEFAULT_LINUX_CUDA
Post-session environment restoration verified Plausible via clean_environment (tests/cli/test_environment.py:45-58), which registers a monkeypatch undo entry even for absent keys by setenv then immediate pop. Non-obvious but works with pytest's monkeypatch
"Windows behavior unchanged" True by inspection (environment.py:68-75) but untested — every test skips on os.name == "nt"
Downstream consumer actually honors the preserved CUDA_HOME Not claimed, not tested. In-repo consumers: ignition/preparation/kv_codec.py:21-38 _find_nvcc prefers torch's CUDA_HOME then which("nvcc") then /usr/local/cuda; tests/preparation/test_toolchain.py:31-69 asserts libdevice comes from torch's CUDA_HOME (derived at torch import time); scripts/qualify_qsa_fixed_partitions.py:229-230 (not opened) requires CUDA_HOME=/opt/cuda
Anyone outside the PR proposed this design No: #636 has no maintainer reply despite being labeled triage:design-review

Limitations the author discloses honestly: Windows not executed; no end-to-end GPU preparation. Undisclosed in evidence terms: no multi-toolkit host run, which is the exact scenario in #636.

Process note I could not verify: .githooks/commit-msg:14-63 requires a Design-Signed-Off-By: …; design-review=<sha256[:4]> trailer on every commit; the commit message body of 682152b is not readable here, so trailer compliance is unverified.

Reach

Process

Open and marked ready for review; opened and last updated 2026-12-02 (same day); head 682152b, base main; 5 files +183/−10; no labels, no reviewers, no reviews, no CI checks on the head commit. Description follows the required four-part form (principle 16, docs/design-review.md:147-160: why / what changed / claimed result / evidence + limitations) and carries the Discord handle required by principle 17. Issue #636 carries triage:design-review, so the design question is queued for review rather than settled. Age: hours old at time of this case file; no rebase or conflict signals yet.

Open questions / what could not be found

  1. Does a maintainer endorse #636's premise that CUDA_HOME should outrank /usr/local/cuda by default? Nothing recorded; the issue is labeled triage:design-review and has no reply.
  2. Is the ambient-TRITON_PTXAS_PATH override intended as part of this fix, or incidental? It is not in #636's ask and contradicts principle 10's "explicit user values win".
  3. Do docs/cli-design.md:46-53 and AGENTS.md:452-455 need amending for the principle-10 exception to cover CUDA_HOME? Not addressed by the PR.
  4. Can #71's -lcudart failure recur if a user's CUDA_HOME points at a pip cuda-tile bundle? Plausible, untested, undiscussed.
  5. What verifies that downstream consumers (torch/kv_codec._find_nvcc/FlashInfer JIT libdevice) really follow the preserved value on a real multi-toolkit host? Nothing in this PR; #231's review asks for exactly that test.
  6. Windows path: claimed unchanged, untested.
  7. Commit trailer compliance (Design-Signed-Off-By) unverifiable from the copy available here.
  8. No CI check run on head 682152b; the 146-passed figure is author-reported.