Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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 focuses on improving the clarity and user experience within Flax NNX, particularly by refining error messages related to tree-mode and graph-mode interactions. It also updates and expands the documentation to ensure it accurately reflects the latest API usage and provides comprehensive guidance for new and existing users, especially concerning state management and transformations. 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. 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. Footnotes
|
f752185 to
7033647
Compare
There was a problem hiding this comment.
Code Review
This pull request improves the scaling up guide by adding Samuel Anklesaria as a co-author, updating code examples to reflect recent API changes in NNX, and fixing some errors in the flax_gspmd.ipynb notebook. The review focuses on identifying and addressing issues of medium or higher severity.
I am having trouble creating individual review comments. Click here to see my feedback.
docs_nnx/guides/flax_gspmd.ipynb (408)
The return statement is missing the optimizer variable. This will cause the training loop to not update the optimizer state, leading to incorrect training. The optimizer should be returned to ensure its state is updated in the training loop.
" return model, optimizer, loss\n
docs_nnx/guides/flax_gspmd.ipynb (475)
The training loop is not updating the optimizer. This will cause the model to train incorrectly. The optimizer should be included in the return statement.
" model, optimizer, loss = train_step(model, optimizer, input, label)\n
docs_nnx/guides/flax_gspmd.ipynb (50)
This line appears to be incomplete or a remnant of editing. It should be removed or completed to provide meaningful content.
docs_nnx/guides/flax_gspmd.ipynb (386-450)
The traceback indicates a ShardingTypeError due to sharded contracting dimensions in jnp.dot. This suggests an ambiguity in how the output should be sharded. To resolve this, explicitly specify the out_sharding parameter in the jnp.dot call within the DotReluDot.__call__ method.
docs_nnx/guides/flax_gspmd.ipynb (529-531)
The variable model is not defined in this scope, leading to a NameError. This is likely due to the code being executed in a different context than where model was defined. Ensure that model is accessible within this code block, or that the relevant code is moved to where model is defined.
docs_nnx/flip/5310-tree-mode-nnx.md (70)
This line introduces a new function call. It's important to ensure that check_no_aliases is well-documented and that its purpose is clear to anyone reading the code. Also, consider adding a brief description of what kind of aliases are being checked and why they are problematic in this context.
docs_nnx/guides/flax_gspmd.ipynb (145)
Consider using kernel_metadata instead of kernel_init for specifying the output sharding. This approach is more consistent with the style used for w2 and avoids the need for nnx.with_partitioning.
kernel_metadata={'out_sharding': (None, 'model')},
7033647 to
4444c93
Compare
1e11780 to
03af843
Compare
No description provided.