Skip to content

sync_inference_weights corrupts the sampler for dense Qwen3 models with tied embeddings #87

Description

@qywu

Minimal repro (dense Qwen3-4B-Instruct-2507, tie_word_embeddings: true):

  1. Launch the trainer in full-weight mode on the exact dense-Qwen3 contract (ce_mode: bi_fused, fa4, merge_qkv: false) and xorl-sglang with --rl-on-policy-target xorl --enable-fp32-lm-head on the same model.
  2. Fresh sampler generates perfectly (<guess>CRANE</guess> for the Wordle prompt).
  3. add_inference_endpoint + sync_weights_to_inference(sync_method='nccl_broadcast') from the untrained trainer — i.e. byte-identical weights. Sync reports success: Synced 399 params to 1 endpoint(s), 8,822,848,512 bytes.
  4. The same prompt now yields deterministic garbage ('arn讹tereg游客ashingtonoins Prompt trứng…' — identical string across repeated syncs/restarts, so the sync deterministically writes wrong bytes).

Likely suspect: tied embeddings. Qwen3-4B has tie_word_embeddings: true (Qwen3-8B does not); a scrambled lm_head/embedding readout produces exactly this symptom (coherent-frequency random tokens from step one). Possibly interacting with the exact-contract trainer's wrapped/Class-B parameter representations at extraction time.

Impact: blocks the endpoint-driven Wordle zero-K3 recipe (xorl-client examples/wordle) on tied-embedding dense models via full-weight sync. Found while reproducing the train-inference-mismatch write-up's Wordle experiment (see #84 thread for the K₃ measurements that motivated the full-weight route).

Env: 2×H100, torch 2.11, branch qywu/value-head-critic (sync path identical to main).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions