fix(tf): validate GPU tabulation sizes#5846
Conversation
Reject zero and oversized tabulation layer widths before launching any TensorFlow CUDA or ROCm wrapper. Cover all forward, gradient, and grad-gradient variants with GPU-only regression cases. Coding-Agent: Codex Codex-Version: codex-cli 0.144.4 Model: gpt-5.6-sol Reasoning-Effort: xhigh
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe TensorFlow GPU tabulation wrappers now validate ChangesGPU tabulation validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5846 +/- ##
==========================================
- Coverage 78.58% 78.31% -0.27%
==========================================
Files 1050 1050
Lines 120637 120648 +11
Branches 4356 4357 +1
==========================================
- Hits 94801 94488 -313
- Misses 24278 24599 +321
- Partials 1558 1561 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
1 <= last_layer_size <= 1024before every TensorFlow CUDA/ROCm tabulation wrapper callWhy existing tests missed this
There were no direct TensorFlow tabulation-op GPU tests. Existing PyTorch tabulation coverage uses normal small embedding widths and does not execute these TensorFlow kernels, while real compressed models are also normally well below the device limit. The four existing grad-gradient checks looked like validation but ran only after the GPU wrapper had already launched, and forward/first-gradient paths had no checks at all.
Validation
cmake --build source/build --target deepmd_op -j2pytest source/tests/tf/test_tabulate_gpu_size_validation.py source/tests/tf/test_tabulate.py -q(2 passed, 2 GPU-only tests skipped locally because no usable GPU is exposed)ruff format .ruff check .--Werrorgit diff --checkFixes #5654
Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh
Summary by CodeRabbit
Bug Fixes
Tests