Skip to content

Commit

Permalink
Need to specify types for collection assignment
Browse files Browse the repository at this point in the history
Fixes:

fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:66: error: Unsupported target for indexed assignment ("Mapping[str, Any]")  [index]
fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:67: error: Unsupported target for indexed assignment ("Mapping[str, Any]")  [index]
fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:75: error: Unsupported target for indexed assignment ("Mapping[str, Any]")  [index]
fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:82: error: Unsupported target for indexed assignment ("Mapping[str, Any]")  [index]
fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py:87: error: Unsupported target for indexed assignment ("Mapping[str, Any]")  [index]

fms_mo/quant/quantizers.py:4161: error: Incompatible types in assignment (expression has type "list[int]", variable has type "None")  [assignment]
fms_mo/quant/quantizers.py:4161: error: Argument 1 to "len" has incompatible type "None"; expected "Sized"  [arg-type]
fms_mo/quant/quantizers.py:4162: error: Unsupported target for indexed assignment ("None")  [index]
fms_mo/quant/quantizers.py:4162: error: Value of type "None" is not indexable  [index]

Signed-off-by: Martin Hickey <[email protected]>
  • Loading branch information
hickeyma committed Jan 22, 2025
1 parent f960378 commit a19f6a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion fms_mo/aiu_addons/i8i8/i8i8_aiu_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Standard
from typing import Mapping
from typing import MutableMapping

# Third Party
from fms.utils import serialization
Expand Down Expand Up @@ -46,7 +47,7 @@ def _int8_qparams_aiu(


def _add_defaults_and_concat(
new_sd: Mapping[str, torch.Tensor],
new_sd: MutableMapping[str, torch.Tensor],
modules_seen: set,
) -> None:
"""
Expand Down
4 changes: 2 additions & 2 deletions fms_mo/quant/quantizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4035,8 +4035,8 @@ def __init__(
self.reset_ReSig_param(multimodal)

self.beta = 2 / 3
self.Wshape = None
self.reshape2 = None
self.Wshape: list[Any] = list()
self.reshape2: list[Any] = list()

def forward(self, x):
if self.useSAWB:
Expand Down

0 comments on commit a19f6a5

Please sign in to comment.