8000 Modify internal base image struct by marcusmartins · Pull Request #1712 · replicate/cog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Modify internal base image struct #1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 18, 2024
Merged

Conversation

marcusmartins
Copy link
Contributor
@marcusmartins marcusmartins commented Jun 3, 2024

Modify the internal structure on how we store our base image compatibility matrix.

  • Instead of hardcoding base images, we use the latest n versions of CUDA, Python, and Torch from the Torch compatibility matrix.
  • Patch versions are stripped out.

To improve model startup performance, we are providing a set
of pre-built image based based on a combination of python, pytorch
and CUDA versions.

The current version stores all the versions as a flat list and it makes a bit
hard to reason about combinations and provide user with feedback on what versions
are available.

The change here makes Python the top level key and store all the CUDA and PyTorch
versions availab
8000
le for each Python version. It would be possible to normalize the struct
more to represent the relationship between CUDA, Python but PyTorch but I don't know if
that's worth doing at this point.

The work here is WIP but sharing it for feedback.

Signed-off-by: Marcus Martins <marcus@replicate.com>
Signed-off-by: Marcus Martins <marcus@replicate.com>
Signed-off-by: Marcus Martins <marcus@replicate.com>
Signed-off-by: Marcus Martins <marcus@replicate.com>
@marcusmartins marcusmartins changed the title Marcus/change base images struct Modify internal base image struct Jun 3, 2024
@marcusmartins marcusmartins force-pushed the marcus/change-base-images-struct branch from dd19205 to 53d2724 Compare June 3, 2024 16:19
@marcusmartins marcusmartins marked this pull request as ready for review June 3, 2024 16:21
* Base images are now derived from the Torch compatibility matrix
* Only include versions greater or equal to minimums
* Patch versions are stripped

Signed-off-by: andreasjansson <andreas@replicate.ai>
@andreasjansson andreasjansson force-pushed the marcus/change-base-images-struct branch from 05a4506 to 22d179a Compare June 18, 2024 14:50
Comment on lines 53 to 70
func newVersionsMatrix() *cobra.Command {
var cmd = &cobra.Command{
Use: "generate-versions",
Short: "Generate a nested matrix of python, cuda, pytorch versions (json)",
RunE: func(cmd *cobra.Command, args []string) error {
versions := dockerfile.BaseImageConfigurations()
output, err := json.Marshal(versions)
if err != nil {
return err
}
fmt.Println(string(output))
return nil
},
Args: cobra.MaximumNArgs(0),
}
return cmd
}

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between this new command and the existing generate-matrix command implemented below?

Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I can tell, generate-versions was an unused duplicate, so I removed it with 6d6d54c

mattt added 2 commits June 18, 2024 10:00
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt <mattt@replicate.com>
mattt and others added 2 commits June 18, 2024 10:24
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: andreasjansson <andreas@replicate.ai>
@mattt mattt merged commit 0c171ce into main Jun 18, 2024
15 checks passed
@mattt mattt deleted the marcus/change-base-images-struct branch June 18, 2024 19:28
jessie-young pushed a commit that referenced this pull request Jun 21, 2024
* Modify base image struct

To improve model startup performance, we are providing a set
of pre-built image based based on a combination of python, pytorch
and CUDA versions.

The current version stores all the versions as a flat list and it makes a bit
hard to reason about combinations and provide user with feedback on what versions
are available.

The change here makes Python the top level key and store all the CUDA and PyTorch
versions available for each Python version. It would be possible to normalize the struct
more to represent the relationship between CUDA, Python but PyTorch but I don't know if
that's worth doing at this point.

The work here is WIP but sharing it for feedback.

Signed-off-by: Marcus Martins <marcus@replicate.com>

* Fix ordering

Signed-off-by: Marcus Martins <marcus@replicate.com>

* Fix the matrix-generation command

Signed-off-by: Marcus Martins <marcus@replicate.com>

* Generate versions matrix

Signed-off-by: Marcus Martins <marcus@replicate.com>

* Smaller set of base image combinations with aggressive minimums

* Base images are now derived from the Torch compatibility matrix
* Only include versions greater or equal to minimums
* Patch versions are stripped

Signed-off-by: andreasjansson <andreas@replicate.ai>

* Remove duplicate / unused generate-versions function

Signed-off-by: Mattt Zmuda <mattt@replicate.com>

* Update compatibility matrix

Signed-off-by: Mattt Zmuda <mattt@replicate.com>

* Support non-Torch and non-Torch images

Signed-off-by: andreasjansson <andreas@replicate.ai>

---------

Signed-off-by: Marcus Martins <marcus@replicate.com>
Signed-off-by: andreasjansson <andreas@replicate.ai>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt <mattt@replicate.com>
Co-authored-by: andreasjansson <andreas@replicate.ai>
Co-authored-by: Mattt Zmuda <mattt@replicate.com>
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.

4 participants
0