Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ ignore = [
"F405", # https://docs.astral.sh/ruff/rules/undefined-local-with-import-star-usage/
"E712", # https://docs.astral.sh/ruff/rules/true-false-comparison/
"E721", # https://docs.astral.sh/ruff/rules/type-comparison/
"E722", # https://docs.astral.sh/ruff/rules/bare-except/
]

[tool.ruff.lint.per-file-ignores]
Expand Down
2 changes: 1 addition & 1 deletion thunder/benchmarks/benchmark_litgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def train(self):
self.calculate_model_flops()
# Setup throughput Collection
self.throughput = Throughput(window_size=self.max_iters - self.warmup_iters, world_size=world_size)
except:
except Exception:
self.throughput = None
print(
f"Model Flops/Throughput calculation failed for model {self.model_name}. Skipping throughput metric collection."
Expand Down
6 changes: 3 additions & 3 deletions thunder/core/baseutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def fnprint(fn: FunctionType | MethodType | CodeType, first=True) -> Callable:
if first:
try:
source = inspect.getsource(x)
except:
except Exception:
source = "Source could not be found."
else:
source = f"SUBFUNCTION {x.co_name}:"
Expand Down Expand Up @@ -389,7 +389,7 @@ def indent(level):
def is_base_printable_type(typ: type, /) -> bool:
try:
return typ in _type_to_str_map
except:
except Exception:
return False


Expand Down Expand Up @@ -443,7 +443,7 @@ def print_type(typ: type, /, *, with_quotes: bool = True) -> str:
def is_base_printable_literal(x: Any, /) -> bool:
try:
return x in _printable_literals
except:
except Exception:
return False


Expand Down
4 changes: 2 additions & 2 deletions thunder/core/compile_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def get_cache_option() -> CACHE_OPTIONS:
def using_symbolic_values() -> bool:
try:
return get_cache_option() is CACHE_OPTIONS.SYMBOLIC_VALUES
except:
except Exception:
return False


def using_jit() -> bool:
try:
cd, cs = _compile_data.get()
return cd.using_jit
except:
except Exception:
return False
2 changes: 1 addition & 1 deletion thunder/core/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def _kwarg_printables(self):
def _hash(self) -> int:
try:
return hash((self.sym, self._var_args, self._var_output, len(self.kwargs)))
except:
except Exception:
# Since args / output may contain unhashable types
return id(self)

Expand Down
2 changes: 1 addition & 1 deletion thunder/tests/test_fa3_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from flash_attn_interface import flash_attn_func

HAS_FA3 = True
except:
except Exception:
HAS_FA3 = False

import math
Expand Down
4 changes: 2 additions & 2 deletions thunder/tests/test_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def bare_except():
try:
assert is_jitting_with_raise() == jitting
raise ValueError(msg)
except:
except Exception:
assert is_jitting_with_raise() == jitting
return True

Expand Down Expand Up @@ -839,7 +839,7 @@ def main():

try:
model(x)
except:
except Exception:
pass
return weakref.ref(x)

Expand Down
Loading