Skip to content

Conversation

@svetakvsundhar
Copy link
Contributor

Without this change (failing build):

Screenshot 2025-03-30 at 1 28 43 PM

With this change (successful build):

Screenshot 2025-03-30 at 1 29 07 PM

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@svetakvsundhar svetakvsundhar requested review from a team as code owners March 30, 2025 17:29
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Mar 30, 2025
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.

Hello @svetakvsundhar, 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!

Summary of Changes

This pull request upgrades the PyTorch version in the gemma-flex-template Docker image. The base image for the Dockerfile is updated from pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime to pytorch/pytorch:2.6.0-cuda11.8-cudnn9-devel. This change resolves a build failure, as evidenced by the screenshots provided in the PR description.

Highlights

  • PyTorch Upgrade: The PyTorch version in the Dockerfile is upgraded from 2.3.1 to 2.6.0.
  • Base Image Update: The base Docker image is updated to a newer version with CUDA 11.8 and cuDNN 9.
  • Build Fix: This change resolves a build failure, as shown in the provided screenshots.

Changelog

  • dataflow/gemma-flex-template/Dockerfile
    • Updated the base image from pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime to pytorch/pytorch:2.6.0-cuda11.8-cudnn9-devel on line 15.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


Did you know?

The name 'PyTorch' is a reference to Torch, a scientific computing framework, with 'Py' signifying its Python binding.

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

The pull request upgrades the PyTorch version in the gemma-flex-template Docker image. This change aims to resolve a build failure, as evidenced by the provided screenshots. The upgrade appears to be a straightforward version bump.

Merge Readiness

The pull request appears to address a build failure by upgrading the PyTorch version. Given the successful build screenshot, the change seems effective. However, it's crucial to verify that this upgrade doesn't introduce any regressions or compatibility issues with the existing code and dependencies. Since I am unable to directly approve the pull request, I recommend that others review and approve this code before merging. I recommend merging this pull request after verifying the upgrade doesn't introduce regressions or compatibility issues.

# This uses Ubuntu with Python 3.10 and comes with CUDA drivers for
# GPU use.
ARG SERVING_BUILD_IMAGE=pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
ARG SERVING_BUILD_IMAGE=pytorch/pytorch:2.6.0-cuda11.8-cudnn9-devel
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider adding a comment explaining why this specific version (2.6.0) was chosen. Was it the latest stable release, or was it selected for compatibility reasons? This context will be helpful for future maintainers. Also, it would be helpful to note the previous version number in the comment for easier comparison.

ARG SERVING_BUILD_IMAGE=pytorch/pytorch:2.6.0-cuda11.8-cudnn9-devel # Upgraded from 2.3.1 to resolve build failure, verified to be compatible

# This uses Ubuntu with Python 3.10 and comes with CUDA drivers for
# GPU use.
ARG SERVING_BUILD_IMAGE=pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
ARG SERVING_BUILD_IMAGE=pytorch/pytorch:2.6.0-cuda11.8-cudnn9-devel
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to move from runtime to devel? Are there additional tools the devel image gives that are required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the newest Pytorch image, and it worked fine for the build. Would you prefer to stick with runtime images?

Copy link
Contributor

@glasnt glasnt Mar 31, 2025

Choose a reason for hiding this comment

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

The devel image is more than double the size than runtime, and if there's no additional tools that are required for this sample, it's best to use the simplest image available. The runtime image was also released at the same time as the devel image, only the devel image returns first when sorting alphabetically :)

@svetakvsundhar svetakvsundhar requested a review from glasnt March 31, 2025 21:07
@glasnt glasnt merged commit 5756bee into GoogleCloudPlatform:main Mar 31, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants