Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Conversation

nickgg
Copy link
Contributor

@nickgg nickgg commented Jan 23, 2019

Description: Pulling the collectConstants process out of compile meant that we must do it later in the DeviceManager. Practically this would mean storing the IR representation in the CompiledFunction so we can pull out the weight tensors. Instead, we can refactor to use the RuntimeBundle and the Module (both of which we know we have in the DM) and remove the extra state.
Testing: unittests
Documentation:

@nadavrot
Copy link
Contributor

@nickgg The IR is optional. Will your procedure work for backends that don't use the IR?

@nickgg
Copy link
Contributor Author

nickgg commented Jan 23, 2019

@nadavrot Yes, this removes the requirement for the IR.

Copy link
Contributor

Choose a reason for hiding this comment

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

what is the situation when module does not have that constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a consequence of the RuntimeBundle overlap issue you commented on in #2274, the SymbolTable contains both Constants and Placeholders. We only want to copy the contents of the Constants though, obviously.

@nickgg nickgg merged commit dbc90f7 into pytorch:master Jan 23, 2019
@nickgg nickgg deleted the collectConstants branch February 5, 2019 23:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants