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

[Tool] - Add mechanism to save operators' tensors to file #1174

Merged
merged 16 commits into from
Oct 8, 2023
Merged

Conversation

goliaro
Copy link
Collaborator

@goliaro goliaro commented Oct 5, 2023

Description of changes:

Many times we have had to rewrite custom code to save an operator's tensors to file for debugging purposes. This operation is often complicated by the fact that tensors may be partitioned, and the partitions accessed simultaneously (if using tensor parallelism). In addition, tensors are usually overwritten at each decoding step. Further, in speculative inference mode, we want to be able to distinguish the tensors from each SSM and the LLM.

This PR introduces a simple way to automatically save the inference tensors to file. The weights are saved only once per model, whereas the inputs/outputs once per iteration. Currently, the tensors are saved in text format for simplicity, but we can later switch to using a binary format to save space on disk.

To use this debugging tool, set the parameter inference_debugging to True when initializing the Python runtime, or pass the --inference-debugging flag when launching a FlexFlow C++ program.

Related Issues:

Linked Issues:

  • Issue #

Issues closed by this PR:

  • Closes #

This change is Reviewable

@goliaro goliaro changed the title [Tool] - Add mechanism to save an operator's tensors to file [Tool] - Add mechanism to save operators' tensors to file Oct 5, 2023
goliaro

This comment was marked as resolved.

@goliaro goliaro marked this pull request as ready for review October 6, 2023 22:24
@goliaro goliaro merged commit 50ff264 into inference Oct 8, 2023
@goliaro goliaro deleted the debugging branch October 23, 2023 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant