Skip to content

feat(xing4): integrate Engram with staged grouped experts - #1

Closed
Er1ckPang wants to merge 1 commit into
codex/xing4-base-1122from
feat/xing_engram_1122
Closed

Er1ckPang wants to merge 1 commit into
codex/xing4-base-1122from
feat/xing_engram_1122

Conversation

@Er1ckPang

@Er1ckPang Er1ckPang commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

What type of PR is this?

/kind feature

What does this PR do / why do we need it

  • Enable Engram on configured Xing4.0 decoder layers using the shared HyperParallel module.
  • Read the eight Engram architecture settings from YAML or an architecture JSON, including UTF-16 JSON. Resolve Xing4's three hash groups as 2-, 3-, and 4-grams and validate their logical table sizes before construction.
  • Use the staged GroupedExperts from HyperParallel #1594 with Engram-enabled training. Bind EP row ownership, CP history, and separate FSDP units for the Engram embedding and projection.

Review base

The base includes master ab4e6e4 and the cherry-picked Xing4 dependencies PR #3 and PR #2. This draft contains the single Engram adaptation commit.

Verification

  • Meta construction placed Engram at decoder indices 1 and 11. The logical table shapes are [384006168, 256] and [384016682, 256].
  • Ascend 910B3 with CANN 9.2.1 and bundled TorchNPU from MindSpore 3.0.0b0 completed reduced-model forward, backward, and optimizer updates for single-card ordinary residuals, single-card fused mHC, dual-card CP2, and dual-card EP2 with FSDP. EP2 held 80 of 160 physical rows per rank.
  • The native Trainer completed one Muon step each on one card and under EP2 with FSDP. Regression suite: 20 tests and 15 subtests passed.
  • A same-input forward control matched fully masked Engram against a temporary bypass exactly. Enabling Engram changed the foundation loss by 0.0016003 in the reduced model.
  • Full-size verification covered Meta construction. Hardware training used reduced models with synthetic input. Existing checkpoint hash parity requires the original token map and hash multipliers.

Which issue(s) this PR fixes

No issue linked.

Code review checklist

  • Engram shape, mask, and placement regression coverage
  • Reduced-model NPU execution and native Trainer checks
  • Configuration and launch examples in the Xing4 Engram guide

@Er1ckPang Er1ckPang closed this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant