Skip to content

fix(qwen3-ar): deterministic sampling seeds and trainer-state correctness#208

Draft
CjhHa1 wants to merge 3 commits into
Tencent-Hunyuan:mainfrom
CjhHa1:perf/qwen3-ar-optimization
Draft

fix(qwen3-ar): deterministic sampling seeds and trainer-state correctness#208
CjhHa1 wants to merge 3 commits into
Tencent-Hunyuan:mainfrom
CjhHa1:perf/qwen3-ar-optimization

Conversation

@CjhHa1

@CjhHa1 CjhHa1 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • SGLang seeded sampling: derive each sampling_seed from (base_seed, sample_id) via BLAKE2b so RNG assignment is stable across DP sharding, request reordering, and asynchronous completion; validate globally unique sample_ids before rollout.
  • W&B disabled path: advance optimizer_step when telemetry is disabled, matching live logging semantics so checkpoint resume state remains correct.
  • Scalar checksum: support 0-D multi-byte tensors in fingerprint_tensor by reshaping before the uint8 view.
  • Keep production sampling on the fast default path with seed=None and enable_deterministic_inference: false.

Validation

  • Pre-commit checks passed, including Python AST, Ruff check/format, and recipe target resolution.

…ness

Stabilize SGLang seeded sampling with BLAKE2b-derived per-sample seeds and
driver-side sample_id validation before DP scatter. Fix optimizer_step tracking
when W&B is disabled and scalar tensor checksum tracking when W&B is disabled and scalar tensor checksum crashes.
@github-actions github-actions Bot added the need review Ready and waiting for review label Jul 14, 2026
CjhHa1 added 2 commits July 14, 2026 20:44
Remove documentation and test additions so the PR contains only the requested production changes.
Keep the pull request focused on runtime correctness fixes while preserving profiling work locally.
enable_lora: false
# Keep production sampling on SGLang's fast default backend. The
# profiling launcher overrides this to true together with a fixed seed.
enable_deterministic_inference: false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn’t call this deterministic, since that usually implies batch‑invariant behavior.

@CjhHa1 CjhHa1 marked this pull request as draft July 15, 2026 07:34
@github-actions github-actions Bot added wip Draft / work in progress and removed need review Ready and waiting for review labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip Draft / work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants