Conversation
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Greptile SummaryThis PR systematically replaces bare Key changes:
Confidence Score: 4/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Calls API] --> B{Pre-condition check}
B -->|Before PR: bare assert| C[AssertionError\nno context]
B -->|After PR: explicit raise| D{Which error type?}
D -->|Wrong value / range| E[ValueError\nshows actual value + expected]
D -->|Wrong type| F[TypeError\nshows actual type + expected]
D -->|Runtime / state violation| G[RuntimeError\ndescribes state + hint]
C --> H[User must read source\nto understand failure]
E --> I[User sees what value\nfailed and why]
F --> I
G --> I
Last reviewed commit: 78227d8 |
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Przemyslaw Tredak <ptrendx@gmail.com>
for more information, see https://pre-commit.ci
|
/te-ci |
jberchtold-nvidia
left a comment
There was a problem hiding this comment.
LGTM from the TE/JAX side! Thanks! I have not reviewed the core or PyTorch files
| assert FusedAttnFwdPrimitive.inner_primitive is not None | ||
| assert ( | ||
| FusedAttnFwdPrimitive.inner_primitive is not None | ||
| ), "FusedAttnFwdPrimitive.inner_primitive has not been registered" |
There was a problem hiding this comment.
nit SR: If you'd like, appending "This usually occurs when TransformerEngine was not installed properly and the shared library cannot be loaded. Please see the documentation troubleshooting for assistance" but as is it's already an improvement over no message
Signed-off-by: Przemek Tredak <ptredak@nvidia.com>
821e9e6 to
8dee07b
Compare
for more information, see https://pre-commit.ci
|
/te-ci |
| - sx_t: scale tensor for qx_t (if columnwise_usage), None otherwise | ||
| - global_amax_row, global_amax_col: global amax tensors | ||
| """ | ||
| global_amax_col = None |
There was a problem hiding this comment.
The global_amax_col = None initialisation was added to fix a latent bug, but global_amax_row should also be initialised. In the pow_2_scales branch (lines 604–612), neither variable is assigned, so any code path that references global_amax_row afterwards raises a NameError. The original TODO comment (line 609–610) mentions both variables. Since both are returned at line 682, both must be defined:
| global_amax_col = None | |
| global_amax_col = None | |
| global_amax_row = None |
Description
Added better error messages throughout the codebase in order to provide more information when the error gets triggered.