Skip to content

fix(checkpoint_inspector): allow empty --param-to-param-group-map-json - #4403

Merged
asolergi-nv merged 2 commits into
NVIDIA:mainfrom
DAISY-gh:fix/checkpoint-inspector-empty-param-group-map
Apr 24, 2026
Merged

fix(checkpoint_inspector): allow empty --param-to-param-group-map-json#4403
asolergi-nv merged 2 commits into
NVIDIA:mainfrom
DAISY-gh:fix/checkpoint-inspector-empty-param-group-map

Conversation

@DAISY-gh

Copy link
Copy Markdown
Contributor

Fix

tools/checkpoint/checkpoint_inspector.py convert-torch-dist-to-fsdp-dtensor crashes with FileNotFoundError: [Errno 2] No such file or directory: '{}' when --param-to-param-group-map-json is not provided — which is the case in every example shipped in the module docstring.

Root cause: the option's default is the literal string "{}" while the implementation calls open(param_to_param_group_map_json, "r"), i.e. treats the value as a file path.

Changes:

  • default="{}"default=None; help text updated to reflect that the value is a file path.
  • Skip open() when the flag is unset; fall back to an empty dict. All downstream uses already short-circuit on an empty map.

After this fix, the existing Qwen3.5-VL / generic SWiGLU examples in the docstring run without specifying the flag.

The `convert-torch-dist-to-fsdp-dtensor` subcommand unconditionally
`open()`s the value of `--param-to-param-group-map-json`. With the
default value `"{}"`, this raises `FileNotFoundError`, so the examples
in the module docstring (which do not pass this flag) cannot run.

- Change the default from `"{}"` to `None` and update the help text to
  reflect that the value is a file path (matching the implementation).
- Skip loading when the flag is unset and fall back to an empty dict.
  All downstream uses already short-circuit on an empty map.
@copy-pr-bot

copy-pr-bot Bot commented Apr 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@DAISY-gh
DAISY-gh marked this pull request as ready for review April 21, 2026 01:30
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team April 21, 2026 01:31
@wplf
wplf self-requested a review April 21, 2026 05:45
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Apr 23, 2026
@asolergi-nv
asolergi-nv enabled auto-merge April 23, 2026 14:08
@asolergi-nv asolergi-nv added the Final Review PR is in the "final review" stage label Apr 23, 2026
@asolergi-nv

Copy link
Copy Markdown
Contributor

/ok to test 47eb225

@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Apr 23, 2026
@asolergi-nv
asolergi-nv added this pull request to the merge queue Apr 24, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/24870331675

Merged via the queue into NVIDIA:main with commit f78ed05 Apr 24, 2026
62 of 63 checks passed
@svcnvidia-nemo-ci svcnvidia-nemo-ci removed the waiting-on-maintainers Waiting on maintainers to respond label Apr 24, 2026
yangbofun pushed a commit to xlm-research/Megatron-LM that referenced this pull request May 22, 2026
NVIDIA#4403)

Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
yhgalaxy pushed a commit to yhgalaxy/Megatron-LM that referenced this pull request Jun 17, 2026
NVIDIA#4403)

Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
Signed-off-by: yhgalaxy <yhgalaxy@outlook.com>
jon-barker pushed a commit to jon-barker/Megatron-LM that referenced this pull request Jul 10, 2026
NVIDIA#4403)

Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
Signed-off-by: Jon Barker <jbarker@aws-cmh-slurm-1-vscode-02.cm.cluster>
terminator123 pushed a commit to 021ai/Megatron-LM that referenced this pull request Aug 3, 2026
NVIDIA#4403)

Co-authored-by: Antoni-Joan Solergibert <asolergibert@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request Final Review PR is in the "final review" stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants