Skip to content
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

Reported slowness due in variable expansion #1660

Open
connor4312 opened this issue Aug 28, 2024 · 2 comments
Open

Reported slowness due in variable expansion #1660

connor4312 opened this issue Aug 28, 2024 · 2 comments
Labels
needs repro Issue has not been reproduced yet

Comments

@connor4312
Copy link
Member

connor4312 commented Aug 28, 2024

Isidor pointed out a tweet that mentions

S Code’s debugger would lock up whenever I stepped past a line like: S=tensor.untyped_storage()... the debugger window that automatically displays local variables started a dump of over a billion elements from the debug server before it would process any other commands.

I have not attempted to repro myself, but there are a few ways in the debug protocol that cases like this can be handled:

  • Set lazy: true on the VariablePresentationHints of potentially expensive variables so that they aren't expanded without user action
  • Use indexedVariables to allow the client to request a small number of a variable's contained data and page through it

Even if it's unavoidable that a giant variable's data is loaded into the debug adapter, it should use these mechanisms to avoid overloading clients and slowing down interaction on the protocol.

Let me know if there's anything I can help with from the VS Code side :)

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Aug 28, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Aug 28, 2024

I think we likely need to specialize for tensors. We've had other issues with the repr for them too:
#1525

@judej judej assigned debonte and unassigned bschnurr and debonte Oct 14, 2024
@xuanhua
Copy link

xuanhua commented Oct 18, 2024

Hi, glad to see this thread, on debugging large language model, I also face the same issue. Each tensor contains huge amount of data. Each step could cost lot of time on transfering these variables' values. On network of limited speed, this is especially painful for remote debugging LLM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

5 participants