Skip to content

Conversation

@AlapinEnjoyer
Copy link

This change adds a cell that prints the versions of all relevant dependencies used in the notebook.
The goal is to make the environment more transparent and reproducible without needing to launch a colab instance each time to inspect which versions are preinstalled.

I added this because the recent peft update (0.18.0) is currently incompatible with unsloth which made the notebook non-reproducible. By explicitly showing the installed versions, it becomes easier to detect such discrepancies and ensure that dependency versions remain stable over time.

We could consider adding this version reporting cell to all notebooks, or alternatively pin the critical dependencies directly?

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AlapinEnjoyer, 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 the reproducibility and transparency of the notebook by introducing a mechanism to report the versions of all installed Python dependencies. This allows users to quickly ascertain the exact software environment, making it easier to debug compatibility issues and ensure consistent execution across different setups.

Highlights

  • Dependency Version Reporting: A new code cell has been added to the notebook to explicitly print the versions of all relevant Python dependencies. This aims to improve environment transparency and reproducibility.
  • Enhanced Reproducibility: This feature was introduced to help identify and prevent issues caused by dependency incompatibilities, such as a recent peft update that broke notebook functionality.
  • Minor Formatting and Unicode Updates: Various cosmetic changes were made across the notebook, including updates to emojis, special characters, and the internal representation of code cell sources (from single strings to arrays of strings).
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.

Copy link
Contributor

@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 adds a useful feature to the notebook by including a cell that prints the versions of all relevant dependencies. This is a great step towards improving the reproducibility and transparency of the environment.

My main feedback is to ensure the version checking is complete and correct. I've left a comment with a suggestion to update the list of packages to include all dependencies installed in the notebook and to use the correct distribution names (which sometimes use hyphens) for importlib.metadata to find them.

Otherwise, the changes are good and the goal of the PR is well-achieved.

Comment on lines +92 to +97
"packages = [\n",
" \"unsloth\", \"torch\", \"bitsandbytes\", \"accelerate\", \"xformers\",\n",
" \"peft\", \"trl\", \"triton\", \"cut_cross_entropy\", \"unsloth_zoo\",\n",
" \"sentencepiece\", \"protobuf\", \"datasets\", \"huggingface_hub\",\n",
" \"hf_transfer\", \"transformers\"\n",
"]\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This is a great addition for reproducibility! However, for the version checking to work correctly for all packages, a few adjustments are needed in the packages list:

  1. Use distribution names: importlib.metadata.version() expects package distribution names, which often use hyphens instead of underscores. The following packages need to be renamed:

    • cut_cross_entropy should be cut-cross-entropy
    • unsloth_zoo should be unsloth-zoo
    • huggingface_hub should be huggingface-hub
    • hf_transfer should be hf-transfer
  2. Include all dependencies: The list is missing mamba_ssm and causal_conv1d, which are installed in the notebook. Their distribution names are mamba-ssm and causal-conv1d.

Here is the corrected list of packages:

packages = [
    "unsloth", "torch", "bitsandbytes", "accelerate", "xformers",
    "peft", "trl", "triton", "cut-cross-entropy", "unsloth-zoo",
    "sentencepiece", "protobuf", "datasets", "huggingface-hub",
    "hf-transfer", "transformers", "mamba-ssm", "causal-conv1d",
]

@danielhanchen
Copy link
Contributor

@AlapinEnjoyer Re peft - I added a fix so it should work now ie pip install --upgrade --force-reinstall --no-deps unsloth unsloth_zoo

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