Skip to content

docs(k8s): fix broken docs links and PVC name in Helm README - #1

Draft
chethanuk wants to merge 1 commit into
mainfrom
fix/issue-3054-missing-k8s-guide
Draft

chethanuk wants to merge 1 commit into
mainfrom
fix/issue-3054-missing-k8s-guide

Conversation

@chethanuk

@chethanuk chethanuk commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes the broken Kubernetes guide link reported upstream.

k8s/README.md pointed at three deleted public-docs pages (kubernetes, deployment, troubleshooting) after the upstream PR rewrote docs/ from 22 pages down to 8. The redirects that review flagged as mitigation were never added, and k8s/README.md was never updated.

This PR makes the Helm chart README self-contained and honest:

  • Drop the dead "complete documentation" / Kubernetes / troubleshooting bullets.
  • Retarget Learn More → scaling with an explicit Non-Kubernetes / SLURM subtitle (that is where another upstream PR moved multi-node content; it does not document Helm).
  • Fix the PVC delete command in k8s/README.md and examples/reverse_text/README.md: templates name the PVC <release-name>-shared-data, so prime-rl-shared-data was wrong for the README's own helm install my-exp.
  • Add tests/unit/test_docs_links.py so markdown links into docs.primeintellect.ai/prime-rl/* must resolve to a page in docs/mint.json and a file on disk (the reverse of sync-docs.yml's nav→file check).

Title vs body tradeoff

Issue title says "Missing K8S guide"; issue body is only the broken link. Restoring docs/kubernetes.md would re-publish a guide whose Quick Start fails today: the chart example still references rl/{orch,infer,train}.toml deleted by 1826b1892 (the upstream issue, 2026-02-24). This PR fixes the broken link and refuses to restore a guide that cannot work until the chart is fixed.

Separate higher-priority bug (not this PR)

The Helm chart example (k8s/prime-rl/examples/reverse-text.yaml + values.yaml default cmds) still points at deleted split configs. Chart has been non-functional on main for ~5 months. Please open / label a needs-chart-fix issue: either re-model on the current examples/reverse_text/rl.toml / uv run rl entrypoint, or delete k8s/ until maintained.

Also ask: should public-docs add Mintlify redirects for the old kubernetes / deployment / troubleshooting slugs?

How to test

uv run pytest tests/unit/test_docs_links.py -v
# 5 passed

uvx ruff@0.13.0 check --config=pyproject.toml
uvx ruff@0.13.0 format --check --config=pyproject.toml

# every remaining https URL in k8s/README.md is 200
grep -ohE 'https://[^)]+' k8s/README.md | sort -u | while read -r u; do
  printf '%s -> ' "$u"
  curl -s -o /dev/null -w '%{http_code}\n' -L --max-time 15 "$u"
done

# zero remaining dead slugs
! git grep -nE 'docs\.primeintellect\.ai/prime-rl/(kubernetes|deployment|troubleshooting)' -- '*.md'

# PVC commands match release name
git grep -n 'delete pvc' -- k8s/README.md examples/reverse_text/README.md

Out of scope

  • Restoring docs/kubernetes.md
  • Fixing chart templates/values/example yaml
  • public-docs redirects
  • reverse_text Manual RL rl/*.toml block

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
Finishing Touches

🧪 Generate unit tests (beta)

  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-3054-missing-k8s-guide
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several significant updates, including the addition of support for Qwen3.5 models, improved configuration management with atomic file writing, and enhanced inference deployment flexibility. Key changes include the transition to uv sync --all-packages for environment management, updates to the orchestrator's rollout persistence logic, and improved validation for inference quantization. I have included one review comment regarding the future-proofing of the SM100 architecture check for MXFP8 quantization.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +451 to +453
if capability != (10, 0):
detected = f"SM{capability[0]}{capability[1]}"
raise ValueError(f"inference.quantization='mxfp8' requires SM100, detected {detected}.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check capability != (10, 0) is too strict and not future-proof. It will reject future GPU architectures (e.g., with compute capability 10.1 or 11.0) that will likely support MXFP8. It's better to check for the minimum required major architecture version to ensure forward compatibility.

Suggested change
if capability != (10, 0):
detected = f"SM{capability[0]}{capability[1]}"
raise ValueError(f"inference.quantization='mxfp8' requires SM100, detected {detected}.")
if capability[0] < 10:
detected = f"SM{capability[0]}{capability[1]}"
raise ValueError(f"inference.quantization='mxfp8' requires at least SM100, detected {detected}.")

k8s/README.md links to /prime-rl/kubernetes, /prime-rl/deployment and
/prime-rl/troubleshooting. All three return 404: those pages are not in
docs/ and have no entry in docs/mint.json. Drop the two Kubernetes links
and the troubleshooting bullet — the README's own sections are the chart
documentation — and retarget the deployment bullet at /prime-rl/scaling,
which is where the multi-node and SLURM content lives now.

The uninstall snippets also name the wrong PVC. templates/pvc.yaml names
it {{ .Release.Name }}-shared-data, so after the documented
`helm install my-exp`, `kubectl delete pvc prime-rl-shared-data` fails
NotFound and reads as if the data is already gone.
@chethanuk
chethanuk force-pushed the fix/issue-3054-missing-k8s-guide branch from 273cb63 to 666d2e2 Compare August 11, 2026 21:22
@codeant-ai

codeant-ai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #ced6d Incremental review completed 3629b1b Nov 27, 2026 · 17:42 17:43
✅  Reviewed your PR 666d2e2 Aug 11, 2026 · 21:22 21:24

@codeant-ai

codeant-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Aug 11, 2026
@codeant-ai

codeant-ai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

CodeAnt-AI Description

Remove broken Kubernetes guide links and correct Helm PVC cleanup instructions

What Changed

  • Removed links to unavailable Kubernetes and troubleshooting guides; the Learn More link now points to scaling guidance for non-Kubernetes deployments.
  • Updated both Helm uninstall examples to delete the PVC created for the documented my-exp release.

Impact

✅ No links to missing Kubernetes pages
✅ PVC cleanup targets the documented release
✅ Scaling guidance remains accessible

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

chethanuk pushed a commit that referenced this pull request Aug 29, 2026
…#3411)

## Summary

### Model and checkpoint contract

- Replace the separate standard, GPT-OSS, and Nemotron expert/router
implementations with one canonical MoE tree.
- Store routed expert weights as separate `gate_proj`, `up_proj`, and
`down_proj` parameters. Non-gated experts omit `gate_proj`.
- Nest every custom router at `mlp.router.gate`, routed experts at
`mlp.experts`, and optional shared experts inside `mlp`.
- Store the single selection-only router bias at
`mlp.router.selection_bias`; model-specific checkpoint names are
converted only at the HF boundary.
- Keep shared expert projections canonical. Qwen3.5 alone nests its
scalar sigmoid gate at `mlp.shared_expert.output_gate`, with conversion
mapping the standalone Hugging Face key at the boundary.
- Use the same activation protocol and `FeedForward` implementation for
dense MLPs, shared experts, and grouped experts.
- Make shared-expert construction exclusively parent-owned: model layers
pass an explicit `FeedForward`/subclass or `None`, while `MoEArgs` and
`MoE` never infer or construct one.
- Keep existing HF source layouts at the conversion boundary. GPT-OSS
alone adds the structural split/join required for its interleaved source
tensor.
- Require `.prime-v1` in reusable `<conversion_dir>/prime` caches so
legacy Prime layouts fail before loading.

### MoE runtime contract

- Use one routed execution sequence for every backend: dispatch tokens,
run canonical grouped experts, combine tokens.
- Select grouped expert compute through explicit BF16, DeepGEMM FP8, or
MXFP8 implementations. `MoEArgs` remains architecture-only.
- Select local/Torch or DeepEP token dispatch once during model setup.
Dispatchers own routing metadata, communication, padding, chunking, and
synchronization.
- Keep `TokenDispatcher` as the structural interface while a shared base
owns the canonical run/synchronize sequence; local, Torch, and DeepEP
implementations own only their dispatch/combine details.
- Keep DeepEP combine events, concatenate streams, and flattened
dispatch state owned by each dispatcher; chunking uses the equal input
shape shared by EP ranks and does not synthesize empty chunks.
- Ignore dispatch configuration when expert parallelism resolves to one
rank; local dispatch remains active and DeepEP has no optimizer side
effects.
- Keep grouped expert execution directly in `GroupedExperts.forward` and
router confidence accounting directly in
`TokenChoiceTopKRouter.forward`.
- Shard every canonical expert parameter with one backend-independent
`Shard(0)` placement.
- Keep dense linear quantization, routed-expert compute, and EP
transport independent.
- Remove the TorchTitan module hooks, expert decorator, dynamically
attached process group, backend attributes, tensor-subclass
interception, and process-global MXFP8 patches from the reachable path.
- Vendor the narrow MXFP8 grouped-GEMM and Torch EP transport
implementation in [prime-kernels PR
#1](PrimeIntellect-ai/prime-kernels#1),
preserving the pinned torchao revision and BSD license.

## Public contracts

Checkpoint tree:

- `mlp.router.gate`: `nn.Linear`
- `mlp.router.selection_bias`: optional persistent selection-only buffer
- `mlp.experts.gate_proj`: stacked `nn.Parameter` for gated experts,
absent for non-gated experts
- `mlp.experts.up_proj`: stacked `nn.Parameter`
- `mlp.experts.down_proj`: stacked `nn.Parameter`
- `mlp.shared_expert.{gate_proj,up_proj,down_proj}`: `FeedForward`
projections when present
- `mlp.shared_expert.output_gate`: Qwen3.5-only scalar `nn.Linear`
- expert matrices: `[num_experts, output_features, input_features]`

Runtime configuration:

```toml
[trainer.model.moe.compute]
type = "bf16"  # bf16 | deepgemm_fp8 | mxfp8

[trainer.model.moe.dispatch]
type = "torch"  # torch | deepep
transport = "bf16"  # bf16 | mxfp8 for torch dispatch
```

DeepEP owns its tuning fields:

```toml
[trainer.model.moe.dispatch]
type = "deepep"
num_sms = 20
token_chunk_size = 4096
```

This is intentionally breaking. `enable_grouped_gemm`, `enable_a2a`,
`ep_comm_backend`, `deepep_num_sms`, and `deepep_token_chunk_size` are
removed without aliases.

## Validation completed

- Foundation conversion, detector, marker, state-loading, checkpoint,
NIXL graph, and wire-format tests passed.
- Focused CPU configuration and MoE contracts: 143 passed.
- Focused MoE runtime configuration parametrizations after the EP=1
no-op change: 6 passed.
- Affected custom-model CUDA suite: 24 passed, 3 skipped across AFMoE,
GLM, GPT-OSS, Nemotron, Qwen3/Qwen3.5, and state loading.
- Final H200 model suite after execution-path cleanup: 81 passed, 3
skipped (Slurm 2597).
- Torch EP on two H200 GPUs passed with BF16 and DeepGEMM FP8, top-k 2,
both score locations, shared experts, gated/non-gated/bias variants,
uneven routing, a rank receiving zero routed tokens, and
input/router/expert gradients.
- Final Torch EP BF16 and DeepGEMM FP8 matrix passed after the cleanup
(Slurm 2596).
- DeepEP on two H200 GPUs passed with BF16 and DeepGEMM FP8, chunking
on/off, both score locations, shared experts, a rank receiving zero
routed tokens, and gradients.
- Final DeepEP BF16 and DeepGEMM FP8 matrix passed after the cleanup
(Slurm 2595).
- Parent-owned shared-expert construction: 16 focused CPU tests and 64
H200 model tests passed, with 3 expected skips (Slurm 2600).
- Full-graph MoE and shared `FeedForward` compile validation passed
after the ownership cleanup (Slurm 2601).
- Local DeepGEMM FP8 passed across all supported topology, activation,
and bias combinations.
- `torch.compile(fullgraph=True)` forward/backward passed for the full
MoE and shared `FeedForward` across all supported topology/activation
combinations.
- Single-rank DCP and Torch EP + FSDP DCP model/optimizer resume passed.
- The `mxfp8_moe` wheel build includes its public module, manifest, and
license; the module imports against the pinned torchao build.
- Unsupported H200 MXFP8 selection fails before model mutation.
- Review audit: every queued DeepEP combine event is now synchronized,
including chunked execution (two-H200 Slurm 2604).
- Dispatcher review cleanup passed on two H200s: DeepEP BF16/DeepGEMM
with chunking and a zero-receive rank (Slurm 2847), plus Torch EP
topology/bias/zero-receive coverage (Slurm 2848).
- The exact `reverse_text_moe` integration passed end-to-end on two
H200s with an isolated conversion cache (Slurm 2607).
- Conversion ranks now make the create decision on master and validate
`.prime-v1` only after the final all-rank barrier.
- Canonical router selection bias: 12 CPU MoE/conversion tests passed;
CUDA checkpoint loading, Nemotron, and GLM model tests passed, with the
existing GLM BF16 gradient comparison passing on isolated rerun after
one threshold-edge miss (Slurm 2851/2852).
- Ruff, Ruff formatting, compileall, and `git diff --check` passed.

## Deliberate exclusions

- MultiLoRA is not adapted to the new runtime and may fail.
- Fused-MoE trainer integration is removed and will be reconsidered only
after the canonical runtime is finalized.
- Routed-expert selective activation checkpointing is removed; the
remaining selective targets are unchanged.

## Remaining before marking ready

- Run numerical MXFP8 grouped-GEMM and MXFP8 Torch EP transport
forward/backward on SM100 hardware. The available Slurm fleet currently
has only H200 nodes.
- Merge prime-kernels PR #1, publish wheels containing `mxfp8_moe`, and
update the `pyproject.toml`/lock wheel pins. The currently pinned v0.8.0
wheel does not contain this module.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **High Risk**
> This changes the MoE forward/backward path, expert-parallel dispatch,
checkpoint key layout, and trainer TOML in breaking ways across all
custom MoE models.
> 
> **Overview**
> **Breaking trainer config:** MoE is configured via
`[trainer.model.moe.compute]` (`bf16`, `deepgemm_fp8`, `mxfp8`) and
`[trainer.model.moe.dispatch]` (`torch` with `transport`, or `deepep`
with `num_sms` / `token_chunk_size`). Dense
`[trainer.model.quantization]` no longer drives expert GEMMs or EP
transport. Removed flags include `ep_comm_backend`, `deepep_*`,
`moe_use_grouped_mm`, `moe_fused_kernel`, and quantization
`enable_grouped_gemm` / `enable_a2a`.
> 
> **Unified MoE execution:** All custom models share one `MoE`
path—`TokenChoiceTopKRouter`, stacked `GroupedExperts` (`gate_proj` /
`up_proj` / `down_proj`), and a pluggable `TokenDispatcher`
(`LocalTokenDispatcher`, `TorchTokenDispatcher`,
`MXFP8TorchTokenDispatcher`, `DeepEPTokenDispatcher`).
`configure_moe_runtime` wires grouped GEMM backends and dispatch at
setup; EP weight sharding is only `ExpertWeightParallel`. DeepEP
dispatch/combine, grouped-GEMM permutation, and chunk pipelining live in
the new dispatcher layer instead of ad hoc `MoE` hooks.
> 
> **Checkpoint and model surface:** PrimeRL checkpoints rename routed
weights from `w1/w2/w3` to `gate/down/up_proj`, move selection bias to
`mlp.router.selection_bias`, and add GPT-OSS HF↔prime conversion.
`LatentMoE` / Nemotron-specific expert classes are folded into the
canonical tree; dense layers use `FeedForward`. Reusable `prime`
conversion caches must include a `.prime-v1` marker.
> 
> **Removed / docs:** Fused `flash_moe` trainer integration and
`bench_fused_moe.py` are dropped; `routed_experts` selective activation
checkpointing is removed. Docs and examples (e.g. GLM-5) are updated for
the new tables.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ffd5be7. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@chethanuk
chethanuk force-pushed the fix/issue-3054-missing-k8s-guide branch from 666d2e2 to 3629b1b Compare November 27, 2026 17:42
@codeant-ai

codeant-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:XS This PR changes 0-9 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels Nov 27, 2026
@codeant-ai

codeant-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 3629b1bdae48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant