| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
installed_cann_version() was wrapped in `except BaseException`, which also swallows KeyboardInterrupt/SystemExit and prints a misleading 'ascend_cann is missing' message. Use `except Exception` so normal failures are still handled but interrupts propagate. Addresses deepspeedai#8093. Signed-off-by: ajinkyajawale14499 <26092430+ajinkyajawale14499@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
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.