Skip to content

[etLLM] New config system to export_llama #9449

@iseeyuan

Description

@iseeyuan

🚀 The feature, motivation and pitch

Current status

The configuration system in export_llama is limited:

  • Only via cli command. There's no python API. We cannot export an arbitrary nn.Module
  • The cli args are complicated. It's hard for users to get what can be configured
  • It's a bad practice to have flat configs and pass it deeply into various functions

Proposal

  • Similar to the torchtune config system, use Hydra and omegaconf, so that the configs can be organized in yaml file, and overrides by cli.
  • Use structured config, like config.model, config.quantization, etc. Only pass sub configs to each component.
  • Keep config and sub configs at high level and directly pass field values
  • An example of config definition in https://gist.github.com/iseeyuan/df9cd283b46dc574d1d506324258f59b

Steps

Since export_llama is used in many places, we do incremental changes.

  1. convert args to DictConfig with structure.
  2. Refactor functions for composability and unblock internal use
  3. Add new entry point using Hydra
  4. Deprecate the legacy argparser systme.

Alternatives

No response

Additional context

No response

RFC (Optional)

No response

cc @larryliu0820 @mergennachin @cccclai @helunwencser @jackzhxng

Metadata

Metadata

Assignees

Labels

module: llmIssues related to LLM examples and apps, and to the extensions/llm/ codetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions