Skip to content
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

[Core] New Config Paradigm #23

Merged
merged 25 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"cSpell.words": [
"INTERNLM",
"QWEN",
"vidur"
]
}
4 changes: 0 additions & 4 deletions data/device_configs/a100.yml

This file was deleted.

3 changes: 0 additions & 3 deletions data/device_configs/a40.yml

This file was deleted.

3 changes: 0 additions & 3 deletions data/device_configs/h100.yml

This file was deleted.

15 changes: 0 additions & 15 deletions data/model_configs/Qwen/Qwen-72B.yml

This file was deleted.

16 changes: 0 additions & 16 deletions data/model_configs/codellama/CodeLlama-34b-Instruct-hf.yml

This file was deleted.

15 changes: 0 additions & 15 deletions data/model_configs/internlm/internlm-20b.yml

This file was deleted.

15 changes: 0 additions & 15 deletions data/model_configs/internlm/internlm2-20b.yml

This file was deleted.

16 changes: 0 additions & 16 deletions data/model_configs/meta-llama/Llama-2-70b-hf.yml
anmolagarwalcp810 marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

16 changes: 0 additions & 16 deletions data/model_configs/meta-llama/Llama-2-7b-hf.yml

This file was deleted.

16 changes: 0 additions & 16 deletions data/model_configs/meta-llama/Meta-Llama-3-70B.yml

This file was deleted.

16 changes: 0 additions & 16 deletions data/model_configs/meta-llama/Meta-Llama-3-8B.yml

This file was deleted.

17 changes: 0 additions & 17 deletions data/model_configs/microsoft/phi-2.yml

This file was deleted.

7 changes: 0 additions & 7 deletions data/model_configs/openai/gpt3.yml

This file was deleted.

8 changes: 0 additions & 8 deletions data/model_configs/tiiuae/falcon-180B.yml

This file was deleted.

4 changes: 1 addition & 3 deletions vidur/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from vidur.config.config import Config

__all__ = [Config]
from .config import *
30 changes: 30 additions & 0 deletions vidur/config/base_fixed_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from abc import ABC
from dataclasses import dataclass
from typing import Any

from vidur.config.utils import get_all_subclasses


@dataclass
class BaseFixedConfig(ABC):

@classmethod
def create_from_type(cls, type_: Any) -> Any:
for subclass in get_all_subclasses(cls):
if subclass.get_type() == type_:
return subclass()
raise ValueError(f"[{cls.__name__}] Invalid type: {type_}")

@classmethod
def create_from_name(cls, name: str) -> Any:
for subclass in get_all_subclasses(cls):
if subclass.get_name() == name:
return subclass()
raise ValueError(f"[{cls.__name__}] Invalid name: {name}")

@classmethod
def create_from_type_string(cls, type_str: str) -> Any:
for subclass in get_all_subclasses(cls):
if str(subclass.get_type()) == type_str:
return subclass()
raise ValueError(f"[{cls.__name__}] Invalid type string: {type_str}")
16 changes: 16 additions & 0 deletions vidur/config/base_poly_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from abc import ABC
from dataclasses import dataclass
from typing import Any

from vidur.config.utils import get_all_subclasses


@dataclass
class BasePolyConfig(ABC):

@classmethod
def create_from_type(cls, type_: Any) -> Any:
for subclass in get_all_subclasses(cls):
if subclass.get_type() == type_:
return subclass()
raise ValueError(f"Invalid type: {type_}")
Loading