Skip to content

feat(nydusify): support convert raw format of modctl artifact#199

Merged
chlins merged 1 commit intomodelpack:mainfrom
BraveY:feat-nydusify-raw
Jun 10, 2025
Merged

feat(nydusify): support convert raw format of modctl artifact#199
chlins merged 1 commit intomodelpack:mainfrom
BraveY:feat-nydusify-raw

Conversation

@BraveY
Copy link
Contributor

@BraveY BraveY commented Jun 10, 2025

This pull request updates the mediaTypeChunkSizeMap in the nydus.go file to include new media types for raw model weights and datasets. These changes ensure that the chunk size mapping accommodates additional media types.

Updates to chunk size mapping:

Signed-off-by: Yang Kaiyong <yangkaiyong.yky@antgroup.com>
Copy link

@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 @BraveY, 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

Hello! Gemini here, providing a summary of this pull request. This PR, authored by BraveY, aims to enhance the nydusify functionality by adding support for converting raw format model weights and datasets. The core change involves updating the mediaTypeChunkSizeMap within the nydus interceptor to recognize and handle these new raw media types, assigning them the standard 64MB chunk size used for their non-raw counterparts. This ensures that raw artifacts can be processed correctly during the nydus conversion process.

Highlights

  • Support for Raw Artifacts: Adds recognition and handling for raw format model weights (modelspec.MediaTypeModelWeightRaw) and datasets (modelspec.MediaTypeModelDatasetRaw) during nydus conversion.
  • Chunk Size Mapping Update: Modifies the mediaTypeChunkSizeMap to include the newly supported raw media types, assigning them a default chunk size of 64MB.

Changelog

  • pkg/backend/build/interceptor/nydus.go
    • Added modelspec.MediaTypeModelWeightRaw to the mediaTypeChunkSizeMap with a value of 64 * 1024 * 1024.
    • Added modelspec.MediaTypeModelDatasetRaw to the mediaTypeChunkSizeMap with a value of 64 * 1024 * 1024.
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.

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

@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 PR clearly and effectively adds support for raw format model weights and datasets in the nydusify process by updating the mediaTypeChunkSizeMap. The changes are well-scoped and directly address the intended feature. The code is straightforward, easy to understand, and aligns with existing patterns. Great job on this addition!

Summary of Findings

  • Code Maintainability: Repeated Chunk Size: The chunk size 64 * 1024 * 1024 is now used for four media types in mediaTypeChunkSizeMap (lines 39-42 in pkg/backend/build/interceptor/nydus.go). For improved readability and maintainability, consider defining this value as a named constant, for example: const ModelArtifactChunkSize = 64 * 1024 * 1024 (potentially near the existing DefaultFileChunkSize constant). Using such a constant would make the intent clearer and simplify future updates if this shared chunk size needs to be changed. This was not added as a specific review comment due to the issue being considered low severity per general guidelines and the current review settings.

Merge Readiness

This pull request appears to be in good shape and ready for merging. The changes are correct, clearly implemented, and fulfill the PR's stated objective. A minor point for future consideration regarding code maintainability has been noted in the findings summary, which can be addressed at the author's discretion. As an AI assistant, I am not authorized to approve pull requests; please ensure this change is reviewed and approved by team members before merging.

Copy link

@imeoer imeoer left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@chlins chlins merged commit 4e0ee96 into modelpack:main Jun 10, 2025
5 checks passed
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.

3 participants