Skip to content

Simplify puzzletron test configs: use HF model names and shared base YAMLs#1039

Merged
kevalmorabia97 merged 7 commits intodkorzekwa/any_model_other_modelsfrom
kmorabia/simplify-dkorzekwa/any_model_other_models
Mar 17, 2026
Merged

Simplify puzzletron test configs: use HF model names and shared base YAMLs#1039
kevalmorabia97 merged 7 commits intodkorzekwa/any_model_other_modelsfrom
kmorabia/simplify-dkorzekwa/any_model_other_models

Conversation

@kevalmorabia97
Copy link
Copy Markdown
Collaborator

@kevalmorabia97 kevalmorabia97 commented Mar 13, 2026

What does this PR do?

Type of change: New tests / Refactoring

Simplifies the puzzletron test infrastructure by:

  1. Removing hf_configs/ folder — HuggingFace configs are now loaded on-the-fly via AutoConfig.from_pretrained(hf_model_name) instead of from cached static files.

  2. Removing HF_MODEL_CARD_NAMES mapping — HF model names (e.g. meta-llama/Llama-3.1-8B-Instruct) are passed directly as test parameters.

  3. Replacing hardcoded VL model check with hasattr(config, "text_config") and hasattr(config, "vision_config") for generic detection.

  4. Unifying ~6k lines of near-identical YAML into shared base configs with per-model overrides:

    • validate_model_defaults.yaml, validate_solutions_defaults.yaml — shared validation params
    • pruning/pruning_defaults.yaml, pruning/ffn_pruning_base.yaml, pruning/attn_pruning.yaml, pruning/hidden_dim_pruning.yaml — shared pruning bases
    • Per-model dirs now follow HF model card paths (meta-llama/Llama-3.1-8B-Instruct/) and contain only model-specific overrides (e.g. just the layer_descriptor._target_ class)
  5. Removing hydra_config_subdir parameter from test parametrize — config path is derived from hf_model_name directly.

  6. Removing unused bypass: entries from all per-model main YAMLs.

Usage

# Test parametrize now uses HF model names directly:
("meta-llama/Llama-3.1-8B-Instruct", "llama", None, False),

Testing

All 8 parametrized test cases in test_puzzletron.py pass:

  • meta-llama/Llama-3.1-8B-Instruct
  • meta-llama/Llama-3.2-3B-Instruct
  • Qwen/Qwen2.5-7B-Instruct
  • Qwen/Qwen3-8B
  • Qwen/Qwen3-VL-30B-A3B-Instruct
  • mistralai/Mistral-Small-24B-Instruct-2501
  • nvidia/NVIDIA-Nemotron-Nano-12B-v2
  • nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16

CI Job: https://github.com/NVIDIA/Model-Optimizer/actions/runs/23087216443/job/67065820836

Before your PR is "Ready for review"

  • Is this change backward compatible?: N/A (test-only changes)
  • If you copied code from any other source, did you follow IP policy in CONTRIBUTING.md?: N/A
  • Did you write any new necessary tests?: N/A (refactoring existing tests)
  • Did you update Changelog?: N/A

Additional Information

Hydra packaging notes (non-obvious fixes required):

  • Added # @package _global_ to all per-model main YAMLs — needed when config_name contains path separators, otherwise Hydra nests all keys under the org/model package
  • Added @_here_ to sub-defaults inside pruning/ configs — prevents Hydra from compounding the pruning package at each inheritance level (pruningpruning.pruningpruning.pruning.pruning)
  • Moved hydra/hydra_logging=disabled from YAML defaults list to overrides= in puzzletron.py — the YAML override syntax broke with nested config paths

Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 requested a review from a team as a code owner March 13, 2026 21:46
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • main
  • release/.*
  • feature/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42a97d7c-93da-4a3a-ba73-6923b4b6905c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kmorabia/simplify-dkorzekwa/any_model_other_models
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevalmorabia97 kevalmorabia97 requested a review from a team as a code owner March 14, 2026 08:17
@kevalmorabia97 kevalmorabia97 requested review from ChenhanYu and removed request for a team March 14, 2026 08:17
@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/simplify-dkorzekwa/any_model_other_models branch from 08cf5d9 to 6380ec1 Compare March 14, 2026 08:49
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/simplify-dkorzekwa/any_model_other_models branch 2 times, most recently from 74849ea to 9124574 Compare March 14, 2026 10:50
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 force-pushed the kmorabia/simplify-dkorzekwa/any_model_other_models branch from 9124574 to b1f9faf Compare March 14, 2026 10:58
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 removed the request for review from ChenhanYu March 14, 2026 11:41
…y-dkorzekwa/any_model_other_models

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
…led for now: # "nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-Base-BF16": 4.7737884521484375,

Signed-off-by: Daniel Korzekwa <dkorzekwa@nvidia.com>
@kevalmorabia97 kevalmorabia97 merged commit 1357b26 into dkorzekwa/any_model_other_models Mar 17, 2026
11 checks passed
@kevalmorabia97 kevalmorabia97 deleted the kmorabia/simplify-dkorzekwa/any_model_other_models branch March 17, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants