Skip to content

docs: Small update to sft documentation - #12

Merged
parthchadha merged 5 commits into
mainfrom
ashors/sft-doc
Mar 21, 2025
Merged

parthchadha merged 5 commits into
mainfrom
ashors/sft-doc

Conversation

@ashors1

@ashors1 ashors1 commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Changelog

  • Please update the CHANGELOG.md under next version with high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

Before your PR is "Ready for review"

Pre checks:

Checklist when contributing

  • TBD

Additional Information

  • Related to # (issue)

@github-actions github-actions Bot added the Documentation Improvements or additions to documentation label Mar 21, 2025
parthchadha
parthchadha previously approved these changes Mar 21, 2025
Signed-off-by: ashors1 <[email protected]>
parthchadha
parthchadha previously approved these changes Mar 21, 2025
SahilJain314
SahilJain314 previously approved these changes Mar 21, 2025
@ashors1
ashors1 dismissed stale reviews from SahilJain314 and parthchadha via 495bf2c March 21, 2025 06:11
@parthchadha
parthchadha merged commit e28bb21 into main Mar 21, 2025
@parthchadha
parthchadha deleted the ashors/sft-doc branch March 21, 2025 06:27
KiddoZhu pushed a commit that referenced this pull request May 6, 2025
avenkateshha added a commit to avenkateshha/RL that referenced this pull request May 23, 2026
…t API

Address easy-batch items from PR NVIDIA-NeMo#2508 review.

- Move sinkhorn_one_dim / apply_canonicalization_if_enabled /
  clean_model_name_for_filename / project_token_likelihoods to
  nemo_rl/utils/x_token/_shared.py and import from there in the four
  projection-prep CLIs (#5).
- Drop unused sinkhorn (10-iter), debug_projection_map, and
  generate_projection_map from minimal_projection_generator.py (NVIDIA-NeMo#8).
- Move minimal_projection_generator.py's CLI parsing under
  `if __name__ == "__main__":` so the module is importable for the
  P1 dedup harness.
- Rename seq1 / seq2 (and the derivative s1_*/s2_*/used_seq*/joined_seq*/
  seg* names) to student_tokens / teacher_tokens throughout
  TokenAligner._align_single / _align_with_anchors / _align_dp; all call
  sites are internal (NVIDIA-NeMo#11).
- Replace **kwargs in TokenAligner._align_with_anchors with the five
  explicit keyword-only scoring knobs already declared on _align_dp,
  and pass them through named at the _align_single call site (NVIDIA-NeMo#12).
- Remove dead TokenAligner.load_projection_matrix + the private
  _load_projection_components plus the now-orphaned self._projection_*
  attributes; the live projection-load path is
  nemo_rl/algorithms/x_token/utils.py::{get_sparse_projection_matrix,
  get_topk_projection} added in 6336464 (NVIDIA-NeMo#13, NVIDIA-NeMo#14).
- git mv nemo_rl/algorithms/x_token/tokenalign.py -> token_aligner.py
  and update import sites in __init__.py, data/cross_tokenizer_collate.py,
  the four utils.x_token CLIs, and the xtoken-distillation guide; update
  Sphinx :mod: references in algorithms/x_token/utils.py (NVIDIA-NeMo#16).

Incidental: the CLIs previously called TokenAligner._canonical_token,
which was never a class attribute (the helper is module-level); the
new shared helper imports _canonical_token directly so the
use_canonicalization branch isn't broken at runtime.

Signed-off-by: Adithya Hanasoge <[email protected]>
avenkateshha added a commit to avenkateshha/RL that referenced this pull request May 27, 2026
…t API

Address easy-batch items from PR NVIDIA-NeMo#2508 review.

- Move sinkhorn_one_dim / apply_canonicalization_if_enabled /
  clean_model_name_for_filename / project_token_likelihoods to
  nemo_rl/utils/x_token/_shared.py and import from there in the four
  projection-prep CLIs (#5).
- Drop unused sinkhorn (10-iter), debug_projection_map, and
  generate_projection_map from minimal_projection_generator.py (NVIDIA-NeMo#8).
- Move minimal_projection_generator.py's CLI parsing under
  `if __name__ == "__main__":` so the module is importable for the
  P1 dedup harness.
- Rename seq1 / seq2 (and the derivative s1_*/s2_*/used_seq*/joined_seq*/
  seg* names) to student_tokens / teacher_tokens throughout
  TokenAligner._align_single / _align_with_anchors / _align_dp; all call
  sites are internal (NVIDIA-NeMo#11).
- Replace **kwargs in TokenAligner._align_with_anchors with the five
  explicit keyword-only scoring knobs already declared on _align_dp,
  and pass them through named at the _align_single call site (NVIDIA-NeMo#12).
- Remove dead TokenAligner.load_projection_matrix + the private
  _load_projection_components plus the now-orphaned self._projection_*
  attributes; the live projection-load path is
  nemo_rl/algorithms/x_token/utils.py::{get_sparse_projection_matrix,
  get_topk_projection} added in 6336464 (NVIDIA-NeMo#13, NVIDIA-NeMo#14).
- git mv nemo_rl/algorithms/x_token/tokenalign.py -> token_aligner.py
  and update import sites in __init__.py, data/cross_tokenizer_collate.py,
  the four utils.x_token CLIs, and the xtoken-distillation guide; update
  Sphinx :mod: references in algorithms/x_token/utils.py (NVIDIA-NeMo#16).

Incidental: the CLIs previously called TokenAligner._canonical_token,
which was never a class attribute (the helper is module-level); the
new shared helper imports _canonical_token directly so the
use_canonicalization branch isn't broken at runtime.

Signed-off-by: Adithya Hanasoge <[email protected]>
copy-pr-bot Bot pushed a commit that referenced this pull request Jun 7, 2026
…t API

Address easy-batch items from PR #2508 review.

- Move sinkhorn_one_dim / apply_canonicalization_if_enabled /
  clean_model_name_for_filename / project_token_likelihoods to
  nemo_rl/utils/x_token/_shared.py and import from there in the four
  projection-prep CLIs (#5).
- Drop unused sinkhorn (10-iter), debug_projection_map, and
  generate_projection_map from minimal_projection_generator.py (#8).
- Move minimal_projection_generator.py's CLI parsing under
  `if __name__ == "__main__":` so the module is importable for the
  P1 dedup harness.
- Rename seq1 / seq2 (and the derivative s1_*/s2_*/used_seq*/joined_seq*/
  seg* names) to student_tokens / teacher_tokens throughout
  TokenAligner._align_single / _align_with_anchors / _align_dp; all call
  sites are internal (#11).
- Replace **kwargs in TokenAligner._align_with_anchors with the five
  explicit keyword-only scoring knobs already declared on _align_dp,
  and pass them through named at the _align_single call site (#12).
- Remove dead TokenAligner.load_projection_matrix + the private
  _load_projection_components plus the now-orphaned self._projection_*
  attributes; the live projection-load path is
  nemo_rl/algorithms/x_token/utils.py::{get_sparse_projection_matrix,
  get_topk_projection} added in 6336464 (#13, #14).
- git mv nemo_rl/algorithms/x_token/tokenalign.py -> token_aligner.py
  and update import sites in __init__.py, data/cross_tokenizer_collate.py,
  the four utils.x_token CLIs, and the xtoken-distillation guide; update
  Sphinx :mod: references in algorithms/x_token/utils.py (#16).

Incidental: the CLIs previously called TokenAligner._canonical_token,
which was never a class attribute (the helper is module-level); the
new shared helper imports _canonical_token directly so the
use_canonicalization branch isn't broken at runtime.

Signed-off-by: Adithya Hanasoge <[email protected]>
copy-pr-bot Bot pushed a commit that referenced this pull request Jun 7, 2026
…t API

Address easy-batch items from PR #2508 review.

- Move sinkhorn_one_dim / apply_canonicalization_if_enabled /
  clean_model_name_for_filename / project_token_likelihoods to
  nemo_rl/utils/x_token/_shared.py and import from there in the four
  projection-prep CLIs (#5).
- Drop unused sinkhorn (10-iter), debug_projection_map, and
  generate_projection_map from minimal_projection_generator.py (#8).
- Move minimal_projection_generator.py's CLI parsing under
  `if __name__ == "__main__":` so the module is importable for the
  P1 dedup harness.
- Rename seq1 / seq2 (and the derivative s1_*/s2_*/used_seq*/joined_seq*/
  seg* names) to student_tokens / teacher_tokens throughout
  TokenAligner._align_single / _align_with_anchors / _align_dp; all call
  sites are internal (#11).
- Replace **kwargs in TokenAligner._align_with_anchors with the five
  explicit keyword-only scoring knobs already declared on _align_dp,
  and pass them through named at the _align_single call site (#12).
- Remove dead TokenAligner.load_projection_matrix + the private
  _load_projection_components plus the now-orphaned self._projection_*
  attributes; the live projection-load path is
  nemo_rl/algorithms/x_token/utils.py::{get_sparse_projection_matrix,
  get_topk_projection} added in 6336464 (#13, #14).
- git mv nemo_rl/algorithms/x_token/tokenalign.py -> token_aligner.py
  and update import sites in __init__.py, data/cross_tokenizer_collate.py,
  the four utils.x_token CLIs, and the xtoken-distillation guide; update
  Sphinx :mod: references in algorithms/x_token/utils.py (#16).

Incidental: the CLIs previously called TokenAligner._canonical_token,
which was never a class attribute (the helper is module-level); the
new shared helper imports _canonical_token directly so the
use_canonicalization branch isn't broken at runtime.

Signed-off-by: Adithya Hanasoge <[email protected]>
anlthms added a commit to anlthms/RL that referenced this pull request Jul 9, 2026
Five uncommitted fixes from the earlier colo-vs-noncolo attempt, whose
issue ledger (RL.old examples/nemo_gym/colocated_vs_noncolocated.md)
documents a colocated run completing step 1 + checkpoint end-to-end:

- grpo.py: restart timeout iteration clock after initial buffer fill
  (fill was counted as iteration #1, tripping checkpoint_must_save_by)
- grpo.py: pause engine + collector around checkpoint save (world
  AllGather vs inference-thread reduce_scatter deadlock)
- megatron_worker._wake: barrier BEFORE waking the engine (early-woken
  ranks' inference collectives race the world barrier)
- megatron_worker.prepare_for_generation: disable DDP forward pre-hook
  (train() re-enables it; inference-thread param all-gathers on the DP
  group interleave per-rank and deadlock; param_sync=True also publishes
  post-step weights to the shared buffer)
- megatron_policy_worker: don't clobber saved param_sync_func when
  disable-until-next-train-step runs twice

Colo config: buffer 48->64GB per RL.old issue NVIDIA-NeMo#12 (graph pools + expert
padding workspaces OOM logprobs at 80GB); debug config seqlen 16384 to
avoid empty-completion crash (RL.old issue NVIDIA-NeMo#6).

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Anil Thomas <[email protected]>
pthombre added a commit that referenced this pull request Sep 5, 2026
Full-suite job 6920206 (5266+ tests, default + --nemo-gym-only lanes)
surfaced 14 real failures caused by this PR's own changes; the other 26
(6 test_flops_counter + 21 test_policy_validation.py -S) are pre-existing
HF Hub 401/gated-repo failures from missing HF_TOKEN in this sbatch env,
unrelated to this PR.

- test_payload.py: two tests asserted the exact tags dict without the new
  num_routed_experts_backfilled key (comment #12's fix); one of the fixture
  completions is a _failed_completion() that genuinely gets backfilled, so
  its count is 1, not 0.
- test_rollout_manager.py: two TestGenerateForFinalizationFlow tests
  asserted request.truncated, which no longer exists on ReassemblyRequest
  (comment #20's fix moved truncated computation into the finalizer).
- test_single_controller_actor.py: nine tests construct _step_log_dict by
  hand and were missing the sample_masks key the mask-weighted train/reward
  fix (comment #11) now appends to unconditionally.
- test_rollout_pump.py: one test's fake _master_config was missing
  token_capture, which the finalizer-drop retry path (comment #13 AI-2)
  now reads.

Signed-off-by: Pranav Thombre <[email protected]>
zswerth added a commit to zswerth/RL that referenced this pull request Oct 31, 2026
- Restore the cuda-graph-trace=node default in the outer/policy nsight config
  (the key-set unit test passes unchanged); NRL_NSYS_EXTRA_OPTIONS now treats a
  JSON null as "remove this default" (review NVIDIA-NeMo#1, NVIDIA-NeMo#2).
- Remove the per-worker `nsys sessions list` / `nsys stop --session` sweep from
  VllmInternalWorkerExtension.stop_gpu_profiling and the 30 s post-stop sleep:
  the awaited cudaProfilerStop with capture-range-end=stop finalizes each inner
  report while the worker runs (review NVIDIA-NeMo#3, NVIDIA-NeMo#7, NVIDIA-NeMo#10).
- Build both inner TP-worker configs with one build_inner_nsight_config() in
  nemo_rl/utils/nsys.py (v1 keeps capture-range-end=repeat; the v2 plugin uses
  stop + wait=primary, documented), using the NRL_NSYS_PROFILE_STEP_RANGE
  constant and the validated NRL_NSYS_EXTRA_OPTIONS parser; the plugin imports
  the helper lazily and logs one line on install (review NVIDIA-NeMo#4, NVIDIA-NeMo#5).
- Import RayExecutorV2 directly in the plugin; drop the ImportError fallback so a
  moved executor fails loudly when profiling is requested (review NVIDIA-NeMo#11).
- Align the async start/stop_gpu_profiling with upstream NVIDIA-NeMo#4604 (already on main):
  await collective_rpc only, no outer cudaProfilerStart/Stop, so the outer async
  actor writes no near-empty report; adopt main's unit test verbatim (review NVIDIA-NeMo#8, NVIDIA-NeMo#9).
- Unit tests: plugin (entry point resolves, no-op, install once with one log line,
  call-through, overrides/null removal, fails loudly without RayExecutorV2, bad
  NRL_NSYS_EXTRA_OPTIONS raises at executor startup, vllm-marked contract test
  against the real RayExecutorV2), helper defaults/options, v1 call site, outer
  async profiler untouched; whitelist the plugin in pyrefly.toml (review NVIDIA-NeMo#6).
- Add an end-to-end nightly suite, grpo-llama3.2-1b-instruct-1n8g-megatron-nsys
  (Megatron recipe, vLLM TP=2, async engine): sets NRL_NSYS_*, passes a caller's
  NRL_NSYS_EXTRA_OPTIONS through, and asserts per-class report counts derived from
  the config (policy and inner vllm_tp_worker = engines x TP), no stock-config or
  unfinished captures, and CUDA activity in an inner report. The nightly GPU-hour
  cap is raised by this suite's budget (review NVIDIA-NeMo#12).
- Docs: null removal, the v2 plugin and when it is (not) loaded, failure modes.

Signed-off-by: zswerth <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants