agentleFS
AI-HypercomputerAI-Hypercomputer/maxtext/AGENTS.md

maxtext

AGENTS.md2.5k starsChanged 4 days agoApache-2.0View on GitHub

Shared engineering, JAX/sharding, and testing invariants for authoring and reviewing MaxText changes. * Single Canonical Path: Reuse established MaxText layers, sharding helpers (maybe_shard_with_logical, sharding.constrain), remat tags (checkpoint_name), and logging (max_logging) instead of adding duplicate utilities or hardcoded tunables. Fix issues at the owning layer (config validation, input pipeline, sharding rules, or shared layer) rather than patching callers, and update callers directly when refactoring instead of leaving single-use wrappers or pass-through shims. (Exception: under src/maxtext/m3/models/, each model family intentionally defines self-contained…

Trending

Less talk lately.about the whole repository

Jan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 1 mentionJul 2026: 4 mentionsAug 2026: 7 mentionsSep 2026: 12 mentionsOct 2026: 19 mentionsNov 2026: 2 mentionsDec 2026: 1 mention
Jan 2026Jul 2026Dec 2026
Mentions a month of the AI-Hypercomputer/maxtext repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about AI-Hypercomputer/maxtext

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub (50 times).

On GitHub · 50

45 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Clean Dependencies & Cross-File Contracts: Use concrete types rather than Any, untyped dict bags, or lazy-import hacks that disguise upward …

    line 25
  2. Distinctive:

    Focused Scope & High-Signal Comments: Keep changes small and single-concern (~400-500 net logic lines max.

    line 33
  3. Very specific:

    JIT Purity & Multi-Host Safety: Avoid Python branching on traced arrays, side effects inside jit, unintended recompilation from …

    line 41
  4. Very specific:

    CPU & TPU Test Efficiency: Keep unit tests fast by using minimal model dimensions/expert counts/topologies, jitting init and execution …

    line 68
  5. Very specific:

    Domain Guides, Skills & Self-Review: Follow matching checklists in .agents/review/ (workflows.md, config-checkpoint.md, kernels.md, …

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

MaxText AI Agent Guidelines

Shared engineering, JAX/sharding, and testing invariants for authoring and reviewing MaxText changes.

1. Architecture, Configs, and Error Handling

  • Single Canonical Path: Reuse established MaxText layers, sharding helpers (maybe_shard_with_logical, sharding.constrain), remat tags (checkpoint_name), and logging (max_logging) instead of adding duplicate utilities or hardcoded tunables. Fix issues at the owning layer (config validation, input pipeline, sharding rules, or shared layer) rather than patching callers, and update callers directly when refactoring instead of leaving single-use wrappers or pass-through shims. (Exception: under src/maxtext/m3/models/, each model family intentionally defines self-contained attention, MLP, and decoder blocks rather than sharing cross-model layers; see src/maxtext/m3/README.md.)
  • Typed Pydantic Configs (Fail-Fast): Declare config keys in src/maxtext/configs/ or src/maxtext/m3/configs/ and read config.<field> directly — never use getattr(config, "flag", default) or dict.get(...) fallback defaults (unless indexing dynamic attribute names), redundant isinstance/None checks on guaranteed types, blanket try/except Exception blocks, or silent fallbacks. Release files, GCS handles, profiler sessions, and background threads via context managers or try/finally.
  • Clean Dependencies & Cross-File Contracts: Use concrete types rather than Any, untyped dict bags, or lazy-import hacks that disguise upward or circular dependencies. When changing signatures, config keys, or parameter shapes/ranks/names, update all consumers: checkpoint conversion, LoRA and quantization rules, and optimizer metadata such as Muon dimension numbers (muon_utils.get_muon_weight_dimension_numbers and maxtext_muon_utils.get_maxtext_muon_weight_dimension_numbers). Declare new third-party imports in requirements files (requirements_sync_test.py).
  • Focused Scope & High-Signal Comments: Keep changes small and single-concern (~400-500 net logic lines max; split preparatory refactors from features) without unused speculative parameters. Comment non-obvious why (stop_gradient/custom VJPs, with_sharding_constraint, donated buffers, remat policies, compiler workarounds), not line-by-line code narration.

2. JAX, Distributed Execution, and Performance

  • JIT Purity & Multi-Host Safety: Avoid Python branching on traced arrays, side effects inside jit, unintended recompilation from missing/wrong static arguments, host-device syncs in training or decode loops, materialized or replicated large intermediates instead of sharded ones, extra collectives, Python loops where jax.lax.scan applies, multi-host races (e.g., every host writing the same file), or unsynchronized state shared with async checkpointing or data-loading threads.

3. Testing Standards

  • Spec-Level, Collectible Tests: Name test files *_test.py or *_tests.py (pytest.ini ignores test_*.py) with test* methods. Assert observable end-to-end outcomes and regression cases that fail if the requirement is unmet — never add production shims for SimpleNamespace/MagicMock, assert only assert_called / is not None / shapes / "runs without crashing", or test only disabled/single-device/prefill-only paths when sharding or decode is in scope.
  • Execution Environment & JAX Pitfalls: CPU CI runs with 4 fake devices (--xla_force_host_platform_device_count=4); tests skipping below >4 devices or marked tpu_only/gpu_only are skipped on CPU, and CPU op emulators (e.g., for jax.lax.ragged_all_to_all) do not replace a tpu_only test of the real op. Use assertRaisesRegex rather than bare assertRaises(ValueError) around sharded code, compare gradients as well as outputs in layout/sharding/kernel parity tests, and match tuple-shaped collectives in HLO regexes (e.g., r"\b(all-gather|all-reduce)(?:-start)?\(").
  • CPU & TPU Test Efficiency: Keep unit tests fast by using minimal model dimensions/expert counts/topologies, jitting init and execution (nnx.jit/jax.jit), using linen_wrappers.init_variables to skip discarded ToLinen.init forwards, using eval_shape for HLO/jaxpr/dtype checks, caching shared parity references per class, setting megablox=False (or hardware="cpu") in non-kernel CPU MoE tests, avoiding tpu_only on pure-CPU dot_product tests, splitting monolithic TPU classes and >4-device CPU-mesh subprocesses (tests/utils/cpu_mesh_child.py) (see .agents/review/testing.md).

4. Formatting, Domain Guides, and Workflows

  • Style & License: Include the Apache 2.0 license header on .py files and use 2-space indentation with max line length 122 (pyink, pylintrc).
  • Domain Guides, Skills & Self-Review: Follow matching checklists in .agents/review/ (workflows.md, config-checkpoint.md, kernels.md, performance.md, testing.md), check .agents/skills/ for task workflows (see .agents/README.md), and run a read-only self-review against .agents/review/protocol.md before requesting review.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.