zml/examples: fix Qwen3.5 models on vanilla backend and 4+ GPU#602
Open
phildav wants to merge 1 commit into
Open
zml/examples: fix Qwen3.5 models on vanilla backend and 4+ GPU#602phildav wants to merge 1 commit into
phildav wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue description
With 4 or more devices, 4+ GPU or vanilla 4+CPU, the Qwen models break in forward:
thread 2011 panic: dynamicUpdateSlice expects 'update_' dimensions to be less than or equal to their corresponding dimension in input tensor, got 8 and 4 for axis .hThis is due to
stutter1dbeing called twice.How to reproduce
On a 4xGPU box:
$ bazel run //examples/llm --@zml//platforms:cuda=true -- --model=hf://Qwen/Qwen3.5-0.8B --prompt="What is the capital of France ?"Or just by forcing vanilla, since it selects 4 devices:
$ bazel run //examples/llm --@zml//platforms:cuda=true -- --model=hf://Qwen/Qwen3.5-0.8B --prompt="What is the capital of France ?" --backend=vanillaFix
The fix is adding a bool param to avoid calling
stutter1d()a second time.Open to discussion on other ways to fix it.
Tested
--backend=vanillaon 0.8B dense model 🔴 -> ✅