Deprecate aqt keep deps#4107
Conversation
# Conflicts: # src/maxtext/layers/quantizations.py
|
🤖 Hi @shralex, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
🤖 CI Failure Investigation ReportI have analyzed the recent test failures in the CI pipeline and identified two distinct failure modes: a GPU collective operations conflict (due to a CUDA context pre-emption/corruption issue) and a transient TPU Pathways network timeout (infrastructure/environment flake). 1. GPU Collective Operations Failure (Codebase-Related / Environment)🔍 What Failed
🪵 Error Details & Stack TraceFAILED tests/unit/model_creation_utils_test.py::TestSetupDecodeStateFromNnx::test_returns_linen_train_state_and_annotations - jax.errors.JaxRuntimeError: INTERNAL: NCCL operation ncclAllReduce( send_buffer.opaque(), recv_buffer.opaque(), ToNcclCount(dtype, count), nccl_dtype, ToNcclReduction(reduction_kind), comm_, AsCudaStream(stream)) failed: invalid argument (run with NCCL_DEBUG=WARN for details). Last NCCL warning(error) log entry (may be unrelated) ''.
FAILED tests/unit/multi_token_prediction_test.py::MultiTokenPredictionLayerTest::test_multi_token_prediction_layer_output - jax.errors.JaxRuntimeError: INTERNAL: NCCL operation ncclAllGather( send_buffer.opaque(), recv_buffer.opaque(), ToNcclCount(dtype, count), nccl_dtype, comm_, AsCudaStream(stream)) failed: invalid argument (run with NCCL_DEBUG=WARN for details). Last NCCL warning(error) log entry (may be unrelated) ''.
linux-x86-a2-48-a100-4gpu-r2txm-runner-g6f9c-workflow:1125:1301 [1] external/nccl_archive/src/misc/argcheck.cc:39 NCCL WARN Error: corrupted comm object detected💡 Root Cause Analysis & ContextConfidence: high (confirmed cause)
🛠️ Recommended FixWe can solve this robustly and permanently by unconditionally forcing JAX to initialize early inside diff --git a/tests/conftest.py b/tests/conftest.py
index 99066cc..4fdfdfd 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -37,17 +37,9 @@ if not _absl_flags.FLAGS.is_parsed():
import jax
import os
import importlib.util
-# Force early JAX initialization on GPU to prevent CUDA context conflicts with TensorFlow/PyTorch.
-# If JAX initialization is deferred, TensorFlow/PyTorch (imported during test collection)
-# might initialize CUDA first, causing JAX's subsequent NCCL communicator creation to fail
-# with 'corrupted comm object detected'.
-def _initialize_jax_early():
- _jax_platforms = os.getenv("JAX_PLATFORMS", "").lower()
- _device_type = os.getenv("INPUTS_DEVICE_TYPE", "").lower()
- _has_gpu = (
- "cuda" in _jax_platforms
- or "gpu" in _jax_platforms
- or "cuda" in _device_type
- or "gpu" in _device_type
- or os.getenv("CUDA_VISIBLE_DEVICES") is not None
- or os.getenv("NVIDIA_VISIBLE_DEVICES") is not None
- )
- if _has_gpu:
- try:
- _ = jax.devices()
- except Exception: # pylint: disable=broad-exception-caught
- pass
+# Force early JAX initialization on all platforms to prevent CUDA context conflicts with TensorFlow/PyTorch/Qwix.
+# If JAX initialization is deferred, other libraries (imported during test collection)
+# might initialize CUDA first, causing JAX's subsequent NCCL communicator creation to fail
+# with 'corrupted comm object detected'.
+try:
+ _ = jax.devices()
+except Exception: # pylint: disable=broad-exception-caught
+ pass2. TPU Pathways Integration Failure (Infrastructure/Environment Flake)🔍 What Failed
🪵 Error Details & Stack Trace💡 Root Cause Analysis & ContextConfidence: high (confirmed cause) This failure is a pure infrastructure/environment flake and is completely unrelated to the changes introduced in this PR.
|
…to grain forking tests
…xt corruption from Qwix/TF
TAG=agy CONV=3b4d4117-7188-4ee4-bba3-ef97997bd635
|
🤖 Hi @sarunsingla11722, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
🤖 CI Failure Investigation ReportI have analyzed the recent test failures in the CI pipeline and identified the following: 🔍 What Failed
🪵 Error Details & Stack TraceAttributeError: type object 'ManagedMLDiagnostics' has no attribute 'mldiag'💡 Root Cause Analysis & ContextConfidence: high The test suite failed due to an Specifically, the test file imports the from maxtext.common.managed_mldiagnostics import ManagedMLDiagnosticsand then attempts to mock with mock.patch.object(ManagedMLDiagnostics.mldiag, "machinelearning_run") as mock_run:However, in mldiag, _ = mldiagnostics_modules()It is not defined as a class attribute or property on the 🛠️ Recommended FixThere are two ways to resolve this depending on the design preference: Option A: Update the test to mock the module-level
|
Fix CPU unit test failures in MaxText by correcting the mock targeting in tests/unit/managed_mldiagnostics_test.py. Patch the module-level variable managed_mldiagnostics.mldiag instead of the class object ManagedMLDiagnostics.mldiag. TAG=agy CONV=c308f588-3466-4c58-a889-2e654d2f2b39
TAG=agy CONV=c308f588-3466-4c58-a889-2e654d2f2b39
# Conflicts: # tests/unit/managed_mldiagnostics_test.py
|
🤖 Hi @sarunsingla11722, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
🤖 CI Failure Investigation ReportI have analyzed the recent test failures in the CI pipeline and identified the following: 🔍 What Failed
🪵 Error Details & Stack TraceE jax.errors.JaxRuntimeError: INTERNAL: NCCL operation ncclAllReduce( send_buffer.opaque(), recv_buffer.opaque(), ToNcclCount(dtype, count), nccl_dtype, ToNcclReduction(reduction_kind), comm_, AsCudaStream(stream)) failed: invalid argument (run with NCCL_DEBUG=WARN for details). Last NCCL warning(error) log entry (may be unrelated) ''.
...
E 1125:1303 [2] external/nccl_archive/src/misc/argcheck.cc:39 NCCL WARN Error: corrupted comm object detected💡 Root Cause Analysis & ContextConfidence: Moderate 1. Verdict of the Isolated Debug ExperimentThis PR was constructed specifically to run a clean debug experiment to isolate the root cause of the GPU/NCCL test failures:
2. Deep Dive: Logical Bug vs. Environment/Runner FlakeStandard tests like A likely environment-level culprit is the removal of the network-binding environment variable |
….set_visible_devices The previous fix attempted to prevent TF/Qwix from grabbing the GPU context by forcing an unconditional jax.devices() call in conftest.py. However, calling jax.devices() at import time locks the XLA client configuration prematurely, which breaks downstream integration tests that dynamically set environment variables like NVTE_FUSED_ATTN or context_parallelism before JAX initialization. This caused those tests to experience mismatched shapes/configurations, leading to a cascade of NCCL invalid argument and corrupted comm errors. This commit replaces the early jax.devices() call with a safer alternative: calling tf.config.set_visible_devices([], 'GPU') directly in conftest.py. This successfully prevents TF (imported transitively by qwix) from allocating the GPU without forcing early JAX initialization, resolving the NCCL failures. TAG=agy CONV=1859e9f1-5466-495f-9e75-e9c7c5b3d4e8
Resolves pyink formatting error in tests/conftest.py introduced by previous commit. Resolves multiple pre-existing pylint errors in types.py, maxengine.py, and attention_op.py that were failing the CodeQuality checks because those files were touched in this branch. TAG=agy CONV=1859e9f1-5466-495f-9e75-e9c7c5b3d4e8
…upport recursive intermediate retrieval
# Conflicts: # src/maxtext/configs/types.py # tests/unit/quantizations_test.py
Pull Request: [DEBUG] Test keeping aqtp dependency with Qwix/FP8 code changes
1. Executive Summary & Purpose
This is an isolated debug Pull Request created to diagnose the GPU/NCCL unit and integration test failures observed on the main PR (deprecate-aqt-phase2).
To isolate the root cause, this PR:
in_serve_modelogic, and decoupling type hints). This ensures that the codebase does not importaqt, preventingModuleNotFoundErroron CPU tests.main, meaning theaqtpdependency is still kept in the requirements and lockfiles.By running the GPU tests on this branch, we will cleanly isolate whether the NCCL failures are triggered by the dependency package changes or by the model code changes.
2. Verification & Diagnostic Scenarios
Depending on the outcome of the GPU/CUDA 12 tests on this PR, we will know exactly how to proceed:
Scenario A: The GPU tests PASS on this PR
aqtpdependency from the requirements files.aqtpis installed, it works; whenaqtpis removed, it fails with NCCL. This indicates that removingaqtpchanges howpipresolves other transitive dependencies (e.g. JAX, Jaxlib, or CUDA libraries), introducing a buggy package version.Scenario B: The GPU tests STILL FAIL with the NCCL error on this PR
aqtpis still installed here). It is triggered by one of the model/layer code changes.moe.py,linears.py, etc.3. Checklist
gemini-reviewlabel.