Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary of ChangesHello @safaricd, 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 significantly enhances telemetry performance by optimizing how configuration files are downloaded and cached, and by streamlining the detection of GPU types and retrieval of dependency versions. These changes aim to reduce overhead and improve the responsiveness of the application, particularly in scenarios involving GPU detection and package information lookup, without compromising the accuracy of the collected data. 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
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces several well-motivated performance enhancements to the telemetry system. The changes, such as optimizing dependency version retrieval, improving GPU detection with nvidia-ml-py, and refining the configuration download process, are clear and effective. My review includes a few suggestions to improve exception handling by making it more specific, which will enhance robustness and debuggability. I also noted a minor docstring inconsistency. Overall, these are excellent improvements.
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the performance of the telemetry system. The changes are well-thought-out, focusing on reducing overhead by avoiding costly imports and using more efficient methods for data collection. Key improvements include:
- Caching telemetry configuration for a longer duration and removing cache-busting to improve network performance.
- Introducing a timeout for fetching the telemetry config to prevent blocking.
- Using the lightweight
nvidia-ml-pylibrary for faster GPU detection, with a fallback totorch. - Leveraging
importlib.metadatato get package versions without importing the packages themselves.
The code is cleaner and more robust. I have a few suggestions to further improve error handling and documentation consistency.
| nvmlDeviceGetName(nvmlDeviceGetHandleByIndex(i)) for i in range(counts) | ||
| ] | ||
|
|
||
| # Because NVML runs very fast, we just return the device name |
There was a problem hiding this comment.
Still worth to cache as it will run on every event?
There was a problem hiding this comment.
I was thinking of the same thing, however in some rare cases, GPUs might be attached or detached to a VM, so we'd have to cache this information on-disk with a TTL. Anyway, given that NVML runs within 20-30 milliseconds, not really worth it ATM.
|
|
||
|
|
||
| @lru_cache(maxsize=1) | ||
| def _get_torch_gpu_type() -> Optional[str]: |
There was a problem hiding this comment.
I wonder whether we could get this information eagerly at import time instead of lazily at event creation. Maybe we could even get the info straight from tabpfn.
There was a problem hiding this comment.
We might - an interesting area to explore in the future.
Change Description
Previous state
torch.Changes
nvidia-ml-pyC interfaces.import torchwhen absolutely necessary; as a third step and a fallback.torchis available insys.modulesbecausetabpfnalready imports it.torchfromsys.modules, if available.Results
The following table shows the performance difference with and without telemetry.