Repository navigation
vision: one gate for --vision at open on CUDA and HIP; LFM2 loads its tower only with --vision, Qwen3.5 HIP and Flash Next refuse a missing tower by name - #3456
Conversation
|
@jschmied, thank you. The gate is one shared path with one message, and text-only starts are unchanged. The one default change, a checkpoint that declares a tower no longer loading it without CI's zig job fails at this head:
|
|
@ashhart Thanks. #3467 also changes |
|
@jschmied, thank you for the re-pins; CI is green at de13716. The HIP checks we promised are done on a Strix Halo at that head. The served Qwen 3.8 27B cells are exact (0 of 8 prompt rows differ) and prompt speed is level with main (-1.1% to +0.2% at 2,048 tokens, every range overlapping). With It's queued now; the GB10 A/B runs with its landing.
|
de13716 to
2ec6bee
Compare
|
Thanks @jschmied. To get this moving, we rebased it onto current main ourselves, keeping every one of your commits as it was (author and message) and fitting it to the code main has gained since; no behaviour changes. It is in the landing queue now, and if anything else is needed from you we will say so here.
|
|
I checked The only conflict is the Flash Next block in Igor Lessio - AIFLOW LABS |
2ec6bee to
de6a193
Compare
de6a193 to
ade4ffa
Compare
|
The current head zig build test-qwen-vision-hip-host test-qwen-vision-weights-host test-lfm2-load-host \
test-flashnext-vision-contracts-host test-gradient-serving check-native-cuda-host \
check-native-hip-host -Dhip=true -Dcpu=apple_m1 -j4 --summary allAll 33 build steps passed. The run recorded 49 passing tests and two skips in the LFM2 load suite. Both native build checks and the serving pins passed on the merged tree. This is host and cross-build coverage alongside the separately reported HIP device receipt. Igor Lessio - AIFLOW LABS |
ade4ffa to
6ea71c0
Compare
|
The revised zig build test-qwen-vision-hip-host test-qwen-vision-weights-host \
test-lfm2-load-host test-flashnext-vision-contracts-host test-gradient-serving \
check-native-cuda-host check-native-hip-host -Dhip=true -Dcpu=apple_m1 --summary all
zig test zig/src/core/engine_vision.zig
zig build test-cluster-membership-host tf-config-validate -Dcpu=apple_m1 --summary allUsing Igor Lessio - AIFLOW LABS |
|
Thanks @jschmied for working on a consistent vision gate. I found one blocker on the current head. CUDA's earlier LFM2 validation still rejects every
|
|
Thanks, you're right. Fixed in
Verified:
|
a52de41 to
e32af5a
Compare
core/engine_vision.zig gains gate(), declared() and words(): --vision without a tower is refused as "--vision given but <model> has no vision tower", and a tower without --vision stays unread. LFM2 (d1) on CUDA loads its tower only with --vision; Qwen3.5 on HIP refuses --vision on a text checkpoint instead of serving text; Flash Next on CUDA names the missing tower before a stream loads. The header-only text count skips Qwen-VL, Gemma 4, LFM2-VL, LightOn, DeepSeek and GLM towers too, and a cluster model's non-bool "vision" is refused by name.
… checks stay refusals.lfm2 refused every --vision before lfm2.open ran the gate, so an LFM2-VL server could not load its tower at all. It now checks --tp and --rank alone; the test shows --vision passes and that --tp 2 or --rank 1 with --vision is still refused by name.
Main already holds zig/src/families/qwen3_5/backend/hip/engine/native.zig at 600 lines, so the new VisionWithoutTower refusal line took it to 601 once merged. This drops the blank line after the file's doc comment. No code change.
…nBytes Main's visionBytes now takes the rank and world (rank 0 of 1 here, as in cuda_dense's tests), so the test's three-argument call stopped compiling once merged. Test only.
a89eb01 to
a6b54ce
Compare
|
Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
Head:
a52de41bd5(branchvision-gate-unify, on ashhart's refresh6ea71c058e; the last commit removes LFM2's old--visionrefusal on CUDA, review 7105791776).Each CUDA and HIP family decided
--visionits own way. LFM2 (d1) on CUDA loaded its tower whenever config.json had avision_config. Qwen3.5 on HIP served text when--visionnamed a checkpoint without a tower. Flash Next on CUDAcalled a missing tower an "unsupported Flash Next Qwen-VL tower configuration". This PR gives them one gate in core,
with one message format, and changes nothing else they do.
What changes
Core (shared by every family):
zig/src/core/engine_vision.zig:gate(requested, tower),declared(a, config)andwords(model, err), re-exportedfrom
engine_apiasvisionGate,visionDeclaredandvisionWords.--visionon a checkpoint without a tower returnserror.VisionWithoutTower, worded"--vision given but this checkpoint has no vision tower".
--visionstays unread, and the server starts text-only. Vision stays opt-in.error.VisionNotLoadedis worded " has a vision tower; pass --vision to load it", for a family that has torefuse images itself. No family uses it yet: the server refuses images before family code runs.
declaredis the HIP Qwen check (vision_configabsent or null means no tower), moved to core unchanged. Its testmoved with it.
zig/src/core/checkpoint_weights.zig: the header-only text count used to skip only RADIO's prefixes. It now alsoskips
model.visual.,visual.,vision_tower.,model.vision_tower.,vision.,model.vision_model.,vision_embedder.,embed_vision.,model.vision_encoder.andmodel.vision_projection..tensorWeightBytes(CUDA admission). Nemotron's three local checkpoints(Bolt-74B, Bolt-E4B, Lightning) hold no tensor under any of the new prefixes: their counts are unchanged.
model.multi_modal_projector.. I left thatprefix out on purpose, because audio models use the same name for their audio projector.
zig/src/cluster/config.zig: a model's"vision"that is not a bool is refused as "models..vision: true or false".Before, it silently meant false.
zig/src/server/systemone.zig: the System One picture refusal no longer claims the checkpoint has no tower. It nowreads "this server reads no pictures: start it with --vision on a checkpoint with a vision tower", because a d1
started without
--visionhas a tower.Families (CUDA/HIP only, no Metal file touched):
native/lfm2.zig,families/lfm2/weights.zig): calls the gate after reading the config and beforeopening the driver.
native/cuda_refusal.zig'slfm2no longer refuses--visionahead of that open (it did, sothe gate and the tower were unreachable); it still refuses
--tpand--rank.planandWeights.loadtaketower, and without--visionthe plan holds the languagemodel's pieces alone. d1's pictures now need
--vision.hip/engine/engine.zig,native.zig,vision.zig):--visionon a checkpoint without a tower isrefused through the gate, before the HIP runtime opens. It no longer serves text.
cuda_lanes_load.zig,_explain.zig,_bytes.zig,cuda_images.zig): the gate runs first in open,before a stream, glue, module or weight.
visionBytescounts 0 without a tower, so the open is what refuses, by name.docs/vision.md: one paragraph on the gate.No kernel or
.cufile changes (git diff origin/main -- zig/kernelsis empty), so the five SASS SMs are unchanged.Evidence
Refusals by name, with nothing loaded before them (host tests, x86,
8eca677010):cuda_lanes_vision_test.zigcalls the realopenwith every driver entry point undefined. A textconfig gives
error.VisionWithoutTower, so the refusal fired before the first driver call: no stream, module orbuffer. It also checks the words and
visionBytes == 0.vision.zig's new test callsEngine.loadon a text config with--vision, and getserror.VisionWithoutTowerbeforehip.Runtime.open. The x86 runner has no HIP runtime, so any later refusal wouldhave been a runtime error instead.
--visiona VL header plans exactly the 21 language pieces, at the sameoffsets as with it, and its byte count ends at the last language piece. A header that lacks the tower still plans.
cuda_refusal.zig, test "--vision is each family's to take"):--visionalone passes to the open,and
--visionwith--tp 2or--rank 1is still refused asno_ranks. Planted control: the same test with the oldrefusal put back fails by name (14 pass, 1 fail); on
a52de41bd5the filtered engines-module run passes 15/15.declaredon absent, null,[],"x", object and non-JSON. The clustertest covers
"vision":"yes".vision-gate-unify-control,f481588185, never pushed): the same suites with the threefamily gates removed. With them removed, the three new tests fail by name and nothing else changes:
the HIP test gets
DriverUnavailable, Flash Next getsUnsupportedCheckpoint(a later step of its open), and theLFM2 plan test fails its piece count. Receipt:
vis-x86-hipctl.log.Suites (x86 lane,
-Dfixed-cpu): the lines below are from8eca677010; ona52de41bd5: 23585/23745 tests, 1 failed:environment_flashnext_test"the table holds all 36 settings" (25 switches, not 24). It fails the same way on your refresh6ea71c058ewithout my commit, and main has since updated that test, so it is not from this change.check-native-cuda-host compile-cuda-tests17/17,pr_check.py0 errors,zig fmt --checkclean, lean 165 vs 165 with 0 new.Earlier runs:
zig build -Dfixed-cpu test test-golden test-kernel-contract test-server-security test-pull-security fuzz-cortheon check-release-pathson4b2932ed77(code identical to the head; the head only rewraps docs): 757/760 steps,10048/10128 tests, 1 failed. The failure is
cli_config_test ... serve --config: expand, which fails the same way onmain
41a72fd257(the x86 run on main from 10:18).-Dhip=true test-host-ci-linux-hip test-lfm2-load-host test-cuda-host test-cluster-membership-hoston the head:3630/3658 tests, with only the same
cli_config_testfailing.check-native-cuda-host compile-cuda-tests: 16/16.zig fmt --check: clean.tools/pr_check.py: 0 errors, lean341 vs 341, 0 new.
Served, against main (main vs fix) (GB10, page cache dropped before every start; binaries' md5 in the receipts):
Main
41a72fd257(md512a7c027) against fix8eca677010(md586aa6b99), on CUDA sm_121. Every cell isbyte-identical, 18 of 18:
--vision: greedy 2K, seeded 2K, greedy chat--vision: greedy 2K text, image greedy, image seededSo off == main, and one image reply (greedy and seeded) == main on three checkpoints that have towers. Resident memory
per server is the same on both arms (nvidia-smi once idle after load). Receipts:
runs/{q35,q27,g31}.jsonland theserver logs.
Concurrency and resume are not covered. Neither the decode nor the cache path changes: the gate runs once, at open.
Flash Next is not served here (96 GB checkpoint); its refusal is covered by the host test above.
LFM2 served with
--vision(and its resident bytes) is not checked here, because there is no local LFM2-VL (lfm2_vl)checkpoint. The admission test and the plan test above cover the path from the flag to the tower's pieces.
Questions for @ashhart (not changed here)
TF_DSV41_IMAGES, not--vision. Should it move to the flag and the gate?--visionpolicy differs. Nemotron Parse requires it; dots, GLM-OCR and LightOn start text-onlywithout it; uocr ignores it. Which policy do you want?
NoGemmaVision, NemotronVisionRefused, GLMNoVisionTower, MiniMaxNoMiniMaxVisionShard, Qwen3.5 CUDANoQwenVision. Moving them to thegate's words would change only wording. Do you want that here, or in a follow-up?
Proposed CHANGELOG line (for you to place):
--visiongate in core.--visionon a checkpoint without a tower is refused at startup as"--vision given but this checkpoint has no vision tower", on Qwen3.5 HIP too, which used to serve text.
d1-3B (LFM2-VL) loads its tower only with
--vision. Flash Next names the missing tower. A cluster model's non-bool"vision"is refused, and the header-only text count skips Qwen-VL, Gemma 4, LFM2-VL, LightOn, DeepSeek and GLMtowers. Text-only replies are unchanged.