Skip to content

Conversation

@lengrongfu
Copy link
Contributor

@lengrongfu lengrongfu commented Sep 16, 2025

Purpose

Part of #18953

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

If you are going to be moving PoolerConfig, can you please convert it's fields into InitVars as I did for MultiModalConfig (you can use this as reference)

@mergify
Copy link

mergify bot commented Sep 17, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @lengrongfu.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Sep 17, 2025
@lengrongfu
Copy link
Contributor Author

If you are going to be moving PoolerConfig, can you please convert it's fields into InitVars as I did for MultiModalConfig (you can use this as reference)

Look this pr #24659 after, i know how to convert PoolerConfig fields into InitVar.

I’d like to ask for your advice: what are the benefits of using the InitVar type instead? Currently, using object references between structures is a common practice. Could you explain this to me?

I know that InitVar is only used during initialization, but the parameter pooler_config: Optional["PoolerConfig"] = field(init=False) will still be used after initialization.

I’d really appreciate your input.

@hmellor
Copy link
Member

hmellor commented Sep 17, 2025

what are the benefits of using the InitVar type instead?

My comment was perhaps more relevant for multimodal as the individual multimodal fields were duplicated. The duplication means that you could read the same field from 2 places, i.e. model_config.mm_processor_cache_gb and model_config.multimodal_config.mm_processor_cache_gb. Changing one does not necessarily change the other, which can be risky at runtime. InitVar means you can still pass mm_processor_cache_gb to ModelConfig(...), but the value is only stored in MultiModalConfig.

In this case we just have pooler_config_override.

I don't like pooler_config_override actually, it would be much better to just pass the pooler config instead. Perhaps this is something for a follow up PR.

@hmellor
Copy link
Member

hmellor commented Sep 17, 2025

Forget using InitVar for now, but could you please move the PoolerConfig to pooler.py?

@hmellor
Copy link
Member

hmellor commented Sep 19, 2025

Since I have moved PoolerConfig separately and have an open PR which also moves ModelConfig (while making some QoL improvements), I'm going to close this as superseded by #25252

Thank you for the PR though!

@hmellor hmellor closed this Sep 19, 2025
@lengrongfu lengrongfu deleted the feat/move_model_config branch October 21, 2025 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants