Skip to content

Remove tracing blame when encountering runtime errors #1655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions src/llmcompressor/pipelines/sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ def forward(self, *args, **kwargs) -> Dict[str, Any]:
raise RuntimeError(
"Raised an exception during execution of the following code:\n"
f"```\n{add_line_numbers(self._code.src)}\n```\n"
"This is likely due to a violation of shape assumptions made when "
"tracing"
) from exception
Comment on lines 74 to 77
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The f-string on line 76 has a trailing newline (\n) which is now redundant after removing the subsequent text. Removing it will make the error message cleaner.

Suggested change
raise RuntimeError(
"Raised an exception during execution of the following code:\n"
f"```\n{add_line_numbers(self._code.src)}\n```\n"
"This is likely due to a violation of shape assumptions made when "
"tracing"
) from exception
raise RuntimeError(
"Raised an exception during execution of the following code:\n"
f"```\n{add_line_numbers(self._code.src)}\n```"
) from exception

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a valid suggestion


return outputs
Expand Down