Skip to content

fix(ci_tests): use safe_load in generate ci tests#1763

Open
basheer-cloud wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
basheer-cloud:fix/use-safe-load-in-generate-ci-tests
Open

fix(ci_tests): use safe_load in generate ci tests#1763
basheer-cloud wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
basheer-cloud:fix/use-safe-load-in-generate-ci-tests

Conversation

@basheer-cloud
Copy link
Copy Markdown

I ran into this while reading through the code path around tests/ci_tests/utils/generate_ci_tests.py. Use safe_load in generate ci tests. yaml.load on untrusted input can construct arbitrary Python objects. I kept the patch small and re-ran syntax checks after applying it.

Backward-compat note: This changes a public function signature by replacing mutable defaults with None guards. Call sites stay source-compatible, but callers introspecting defaults will see None now.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 10, 2026

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.

Comment thread nemo_automodel/components/checkpoint/stateful_wrappers.py Outdated
Comment thread nemo_automodel/components/checkpoint/stateful_wrappers.py Outdated

def tpool_patch_merger(
x: torch.Tensor, grid_thws: torch.Tensor, merge_kernel_size: List[int] = [2, 2]
x: torch.Tensor, grid_thws: torch.Tensor, merge_kernel_size: List[int] = None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would keep this as [2, 2]



def patch_merger(x: torch.Tensor, grid_hws: torch.Tensor, merge_kernel_size: List[int] = [2, 2]) -> List[torch.Tensor]:
def patch_merger(x: torch.Tensor, grid_hws: torch.Tensor, merge_kernel_size: List[int] = None) -> List[torch.Tensor]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as prev. comment.

Comment thread tests/ci_tests/utils/generate_ci_tests.py
@chtruong814 chtruong814 added waiting-for-customer Waiting for response from the original author waiting-on-customer Waiting on the original author to respond and removed waiting-for-customer Waiting for response from the original author labels Apr 14, 2026
@akoumpa
Copy link
Copy Markdown
Contributor

akoumpa commented Apr 19, 2026

/ok to test d789859

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

Labels

community-request waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants