Repository navigation
[rl] Removed patched qwen3 parallel plan to core torchtitan Qwen3 parallel plan - #3070
Conversation
There was a problem hiding this comment.
Will revert changes to this file - Just import order change
| parallel_dims.get_mesh("cp"), | ||
| ) | ||
|
|
||
| # Skip FSDP, AC, and compile for inference. FSDP is incompatible |
There was a problem hiding this comment.
For FSDP, here's why FSDP doesn't work with inference mode:
FSDP's pre_forward hook calls unshard() which uses _unsafe_preserve_version_counter to do in-place modifications on parameter tensors (swapping sharded ↔ unsharded views). torch.inference_mode() disables version counting on tensors entirely, so when FSDP tries to access tensor._version, it raises RuntimeError: Inference tensors do not track version counter.
This happens even at dp_shard=1 because FSDP still registers the hooks — it just doesn't do actual communication. The hook still runs the version counter logic.
cc @weifengpy
|
|
||
| if hasattr(self.config, "update_from_config"): | ||
| self.config.update_from_config( | ||
| trainer_config=SimpleNamespace( |
There was a problem hiding this comment.
This is idea from @fegin 's PR and discussion here: #2986 (comment)
As titled.
We need to skip FSDP because FSDP's forward hooks (unshard/reshard) use in-place operations that conflict with torch.inference_mode(). vLLM runs the model forward under @torch.inference_mode() during KV cache profiling and generation.
Also inference don't need mixed precision (now) because all computation / weights are in bf16