Skip to content

Remove support for profile MIG mem & parent slice count#612

Merged
myersCody merged 3 commits intomainfrom
update_nise_mig
Mar 13, 2026
Merged

Remove support for profile MIG mem & parent slice count#612
myersCody merged 3 commits intomainfrom
update_nise_mig

Conversation

@myersCody
Copy link
Copy Markdown
Contributor

uv run nise report ocp --ocp-cluster-id test-mig-cluster --static-report-file tests/ocp_gpu_static_report.yml -w

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the GPU Multi-Instance GPU (MIG) data handling within the OCP generator by eliminating fields that were deemed unnecessary for its operation. The change simplifies the data model and generation process, reducing complexity and potential for redundant data. This update also includes a version bump to reflect the internal changes.

Highlights

  • Version Update: The project version in nise/__init__.py has been incremented from 5.3.7 to 5.3.8.
  • GPU MIG Data Simplification: Removed redundant fields parent_gpu_max_slices and mig_memory_capacity_mib from the OCP GPU usage data model and related processing logic. This streamlines the data structure and generation for Multi-Instance GPU (MIG) configurations.
  • Test Suite Alignment: Updated the test suite to reflect the removal of the parent_gpu_max_slices and mig_memory_capacity_mib fields, including modifications to test data, assertions, and the removal of a specific validation test case.
  • Configuration File Update: Modified tests/ocp_gpu_static_report.yml to remove the now-unused gpu_max_slices and mig_memory_capacity_mib fields from the GPU definitions within the static report configuration.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • nise/init.py
    • Updated the __version__ string from 5.3.7 to 5.3.8.
  • nise/generators/ocp/ocp_generator.py
    • Removed parent_gpu_max_slices and mig_memory_capacity_mib from OCP_POD_USAGE_COLUMNS.
    • Eliminated the max_slices variable and its associated validation and assignment logic within the _gen_gpus method.
    • Removed mig_memory variable and its associated validation and assignment logic within the _gen_gpus method.
    • Updated dictionary creation in _gen_gpus, _gen_hourly_gpu_usage, and _update_gpu_data to no longer include parent_gpu_max_slices and mig_memory_capacity_mib.
  • tests/ocp_gpu_static_report.yml
    • Removed gpu_max_slices and mig_memory_capacity_mib entries from GPU definitions.
  • tests/test_ocp_generator.py
    • Removed gpu_max_slices and mig_memory_capacity_mib from the _mig_gpu_attributes test helper.
    • Updated assertions in test_gen_gpus_yaml_with_mig_instances to remove checks for mig_memory_capacity_mib and parent_gpu_max_slices.
    • Removed the test_gen_gpus_raises_when_mig_without_gpu_max_slices test case.
    • Modified test_gen_gpus_raises_when_mig_instance_missing_required_fields to only validate mig_profile and mig_slice_count.
    • Updated assertions in test_gen_hourly_gpu_usage_includes_mig_fields and test_update_gpu_data to remove checks for mig_memory_capacity_mib and parent_gpu_max_slices.
Activity
  • No human activity recorded for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@myersCody myersCody changed the title Update nise mig Remove support for profile MIG mem & parent slice count Mar 13, 2026
Copy link
Copy Markdown

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

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 updates the MIG (Multi-Instance GPU) data generation by removing the parent_gpu_max_slices and mig_memory_capacity_mib fields. This simplifies the configuration required for MIG instances. The changes are applied consistently across the generator logic, the static report test data, and the unit tests. The code is clean and the related tests have been updated or removed appropriately. I have one suggestion to improve the robustness of a test case to ensure all required fields for a MIG instance are validated.

Comment on lines +1292 to 1299
attrs = self._mig_gpu_attributes(pod_name="incomplete-mig-pod")
del attrs["nodes"][0]["namespaces"]["mig-namespace"]["pods"][0]["gpus"][0]["mig_instances"][0][
"mig_memory_capacity_mib"
"mig_slice_count"
]
with self.assertRaises(ValueError) as ctx:
OCPGenerator(self.two_hours_ago, self.now, attrs)
self.assertIn("mig_profile", str(ctx.exception))
self.assertIn("mig_slice_count", str(ctx.exception))
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

This test is good, but it only covers the case where mig_slice_count is missing. To make it more robust and ensure that the validation works for all required fields, you could parameterize it to test the removal of each required field (mig_profile and mig_slice_count) individually. Using subTest would be a good way to achieve this without creating a separate test method for each field.

Suggested change
attrs = self._mig_gpu_attributes(pod_name="incomplete-mig-pod")
del attrs["nodes"][0]["namespaces"]["mig-namespace"]["pods"][0]["gpus"][0]["mig_instances"][0][
"mig_memory_capacity_mib"
"mig_slice_count"
]
with self.assertRaises(ValueError) as ctx:
OCPGenerator(self.two_hours_ago, self.now, attrs)
self.assertIn("mig_profile", str(ctx.exception))
self.assertIn("mig_slice_count", str(ctx.exception))
for field_to_remove in ["mig_profile", "mig_slice_count"]:
with self.subTest(field_to_remove=field_to_remove):
attrs = self._mig_gpu_attributes(pod_name="incomplete-mig-pod")
del attrs["nodes"][0]["namespaces"]["mig-namespace"]["pods"][0]["gpus"][0]["mig_instances"][0][
field_to_remove
]
with self.assertRaises(ValueError) as ctx:
OCPGenerator(self.two_hours_ago, self.now, attrs)
self.assertIn("mig_profile", str(ctx.exception))
self.assertIn("mig_slice_count", str(ctx.exception))

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.6%. Comparing base (616f677) to head (abfdd28).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #612     +/-   ##
=======================================
- Coverage   93.6%   93.6%   -0.0%     
=======================================
  Files         56      56             
  Lines       4786    4782      -4     
  Branches     670     669      -1     
=======================================
- Hits        4482    4478      -4     
  Misses       164     164             
  Partials     140     140             
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@myersCody myersCody merged commit 98fb2ed into main Mar 13, 2026
5 checks passed
@myersCody myersCody deleted the update_nise_mig branch March 13, 2026 18:33
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