Skip to content

Add docs for eager mode#7700

Merged
JackCaoG merged 2 commits intomasterfrom
JackCaoG/eager_docs
Jul 17, 2024
Merged

Add docs for eager mode#7700
JackCaoG merged 2 commits intomasterfrom
JackCaoG/eager_docs

Conversation

@JackCaoG
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread docs/eager.md Outdated
Comment thread docs/eager.md Outdated
Comment thread docs/eager.md Outdated
Comment thread docs/eager.md Outdated
optimizer.step()
return loss

self.compiled_step_fn = torch_xla.experimental.compile(self.step_fn)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

re: naming, I don't think compiled_step_fn makes sense here. It makes it look like this function is imperatively compiled when you call compile, when what's really happening is that you will trace and JIT-compile the function when it's called later. jit and trace already mean something else in this ecosystem though...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

well that's the trade of I made when I try to align the api with the upstream, I think it creates more confusion to called it jited_step_fn. I will just rename it to step_fn

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you want to just use compile as a decorator here if you're following the upstream convention?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

seem like upstream support both, I can support both too https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html

@JackCaoG JackCaoG requested a review from will-cromar July 17, 2024 22:51
@JackCaoG JackCaoG marked this pull request as ready for review July 17, 2024 23:33
@JackCaoG JackCaoG merged commit ea1a1f4 into master Jul 17, 2024
JackCaoG added a commit that referenced this pull request Jul 19, 2024
bhavya01 pushed a commit that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants