DeepSpeed
10f76c2e - Don't swallow KeyboardInterrupt/SystemExit in NPUOpBuilder (#8096)

Commit
82 days ago
Don't swallow KeyboardInterrupt/SystemExit in NPUOpBuilder (#8096) Addresses #8093. `NPUOpBuilder.__init__` wraps `installed_cann_version()` in `except BaseException:`, which also catches `KeyboardInterrupt` and `SystemExit` and then prints `"... ascend_cann is missing, npu ops cannot be compiled!"`. So hitting Ctrl+C during that call is silently swallowed and turned into a misleading message. This changes it to `except Exception:`, which still catches every normal failure mode (missing CANN path, env var, or version lookup error) but lets interrupts propagate. Scope note: this is the only `BaseException`/bare-`except` clause in the codebase. The `except Exception:` clauses do not catch `KeyboardInterrupt`/`SystemExit` (those are `BaseException`, not `Exception`), so they are out of scope for this specific impact. Narrowing those to more specific types would be a separate, larger change. pre-commit (yapf / flake8 / codespell / license) passes. Signed-off-by: ajinkyajawale14499 <26092430+ajinkyajawale14499@users.noreply.github.com> Co-authored-by: ajinkyajawale14499 <26092430+ajinkyajawale14499@users.noreply.github.com>
Parents
Loading