Remove support for profile MIG mem & parent slice count#612
Conversation
myersCody
commented
Mar 13, 2026
Summary of ChangesHello, 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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| 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)) |
There was a problem hiding this comment.
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.
| 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 Report✅ All modified and coverable lines are covered by tests. 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:
|