Skip to content

Commit

Permalink
Update QuantizationArgs schema to incorporate spinquant, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinb committed Oct 25, 2024
1 parent 5309637 commit 9552efb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions models/llama3/api/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,27 @@
# the top-level of this source tree.

from dataclasses import dataclass
from enum import Enum
from typing import Optional


class QuantizationScheme(Enum):
int4_weight_int8_dynamic_activation = "int4_weight_int8_dynamic_activation"


@dataclass
class QuantizationArgs:
scheme: Optional[QuantizationScheme] = None
group_size: Optional[int] = None
spinquant: bool = False

def __init__(self, **kwargs):
for k, v in kwargs.items():
if k == "scheme":
setattr(self, k, QuantizationScheme(v))
else:
if hasattr(self, k):
setattr(self, k, v)


@dataclass
Expand Down

0 comments on commit 9552efb

Please sign in to comment.