Skip to content

Refactor DeepSeek MoE/Engram scanned decoder tests to use 3 layers#4312

Merged
copybara-service[bot] merged 1 commit into
mainfrom
fix_engram_test
Jul 1, 2026
Merged

Refactor DeepSeek MoE/Engram scanned decoder tests to use 3 layers#4312
copybara-service[bot] merged 1 commit into
mainfrom
fix_engram_test

Conversation

@Shuwen-Fang

@Shuwen-Fang Shuwen-Fang commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Context:
Large rematerialized DeepSeek V4 MoE/Engram scanned decoder tests (test_decoder_init_engram_2_8 and test_decoder_init_engram_4_9) experienced SPMD compilation buffer OOM crashes on 8-core TPU7x slices. This was due to memory pressure from unrolled chunks and workspace doubling on TPU7x (which lacks MegaCore, meaning 2 JAX devices share the same physical chip's HBM).

Solution:
Refactored the tests to use base_num_decoder_layers=3 instead of 5 and 4. This reduces the generated SPMD HLO graph size sufficiently to avoid OOM on TPU7x, while still validating the core scan-chunking compilation logic (Scan -> Engram -> Scan).
Also removed the temporary skip guard that was bypassing these tests on TPU7x.

Bug: b/527535999

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

This avoids compilation OOM on TPU7x-8 slices by reducing the number of layers from 5 and 4 to 3. The skip guard for TPU7x is also removed.
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Shuwen-Fang Shuwen-Fang self-assigned this Jul 1, 2026
@copybara-service copybara-service Bot merged commit a877e45 into main Jul 1, 2026
65 of 67 checks passed
@copybara-service copybara-service Bot deleted the fix_engram_test branch July 1, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants