Fixes in gemma3 tests and sharding - #160
Conversation
Summary of ChangesHello @vfdev-5, 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 refactors the Gemma3 model to align with the latest 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
|
cf11a1c to
e60a54e
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces several significant improvements and fixes for the Gemma3 model implementation. The core change is the removal of custom ShardedLinear and ShardedEmbedding modules, replacing them with standard flax.nnx.Linear and flax.nnx.Embed layers, which simplifies the codebase. The PR also includes workarounds for issues with nnx.eval_shape when loading pretrained models. Additionally, new sharding tests have been added and the test execution script has been updated to run these tests on emulated CPU devices, which is a great addition for CI.
My review found one critical issue where incorrect sharding configurations are being used in SiglipMLP due to variable reuse. Apart from that, the changes are well-implemented and improve the maintainability and test coverage of the model.
39ce102 to
9dab386
Compare
c2e99ab to
cb79d79
Compare
…ests on CPU, 4 emulated devices
cb79d79 to
cfe3dc9
Compare
Description: