Skip to content

fix(kernel): pin tvm-ffi jit arch to the bound gpu - #521

Merged
jason-fxz merged 1 commit into
mainfrom
fix/jit-arch-bound-gpu
Sep 18, 2026
Merged

jason-fxz merged 1 commit into
mainfrom
fix/jit-arch-bound-gpu

Conversation

@jason-fxz

Copy link
Copy Markdown
Collaborator

Pin the tvm-ffi JIT target to the GPU this process is bound to instead of the first GPU nvidia-smi lists, so kernels that miss the prebuilt cache no longer compile for the wrong arch under --gpu or CUDA_VISIBLE_DEVICES on a mixed box (fixes #509).

@jason-fxz
jason-fxz merged commit 1d8a541 into main Sep 18, 2026
JUNQINGV587 added a commit to JUNQINGV587/FreeToken that referenced this pull request Sep 19, 2026
- FlashML-org#521 fix(kernel): pin tvm-ffi jit arch to the bound gpu (kernel/utils.py)
- FlashML-org#518 fix(engine): raise WeightLoadError when the checkpoint cannot be read
  (engine.py) -- this PR is the upstream squash of our own 73f8661 +
  e912542, and it supersedes them (same intent plus the load_expert_banks
  wrap). Resolution: take the upstream side for the conflicting hunks.
- FlashML-org#524 fix(install): resolve sglang-kernel from PyPI, not the sglang index
  (install.sh, pyproject.toml)

Our delta in these four files before the merge was exactly 'lacking these
three upstream commits', so no fork-specific change is dropped.
This was referenced Sep 19, 2026
trcwebdesign pushed a commit to trcwebdesign/FreeToken that referenced this pull request Sep 21, 2026
danielamadori added a commit to danielamadori/DFlash-FreeToken that referenced this pull request Sep 23, 2026
… fuso a mano

Cherry-pick di 1d8a541 di upstream. Il patch non si applicava: il nostro
kernel/utils.py porta c3a1a2c (il flag C++20 per MSVC scritto in una sintassi
che MSVC ignora) che il ramo di 1d8a541 non ha, quindi i due divergevano di 13
righe sullo stesso file.

Fusione a tre vie fatta FUORI dall'albero, perche' il motore gira da questo
checkout in editabile e un conflitto irrisolto sul disco verrebbe raccolto da un
riavvio del supervisore. Un conflitto solo, sugli import: noi avevamo `import
sys`, upstream aggiunge `Iterator` ai tipi per il generatore nuovo. Tenuti
entrambi -- verificato che servano davvero, `sys.` e `Iterator` compaiono una
volta ciascuno nel corpo, non sono import morti.

Sopravvivono entrambe le parti: c'e' `_cuda_arch_list()` di upstream e ci sono
le due occorrenze della nostra correzione MSVC.

DA SAPERE: per noi e' funzionalmente INERTE. La modifica garantisce che tvm-ffi
compili per la GPU a cui il processo e' legato quando TVM_FFI_CUDA_ARCH_LIST non
e' impostata -- e la nostra docstring diceva gia' che in quel caso il percorso e'
un no-op e tvm-ffi punta da solo alla GPU locale. Verificato che quella variabile
non sia impostata ne' nel motore in esecuzione ne' in nessuna configurazione
nostra. Preso per non divergere da upstream, non perche' compri prestazioni: la
ricompilazione dei kernel che forza (cache tvm-ffi di 9,2 MB, 25 oggetti) non va
spacciata per un miglioramento.

Test a CUDA spenta su tests/kernels e tests/engine: 387 passati, 0 falliti, col
motore di produzione in servizio e intatto.
lucaspirola pushed a commit to lucaspirola/FreeToken that referenced this pull request Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Blackwell (sm_120), native kernel silently compiles for sm_89 instead — "no kernel image is available" at first real request

1 participant