Skip to content

Conversation

@colesbury
Copy link
Member

The core autograd Variable, Function, and Engine no longer depend on the
Python API. This let's us implement functions in C++. In the future, we
can also multithread engine and release the GIL for most of the
non-Python backwards.

For now, the only Function implemented in C++ is batch normalization.

The C++ API differs a bit from the Python API:

  • Function only represents either a "forward" or "backward" operation. This is to ease support for "double" backwards and simplify the API.
  • In C++, Function implementations operate on variables and return variables. Implementations are responsible for setting the creator appropriately.
  • Variable extends Function (for now) so that it can be stored in the previous_functions vector.

Most of the Python specific code is in python_xxx.cpp files. There is python_function.cpp for functions implemented in Python and python_native_function.cpp for functions implemented in C++ and exposed in Python.

@colesbury colesbury force-pushed the autograd branch 7 times, most recently from f2e7c33 to 6fcc925 Compare February 1, 2017 02:24
Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

A style thing is that maybe we should unify the file names between autograd (all lowercase) and the main extension (camel case).

This comment was marked as off-topic.

This comment was marked as off-topic.

setup.py Outdated

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@colesbury colesbury force-pushed the autograd branch 5 times, most recently from f06424a to 4a0494f Compare February 3, 2017 18:03

This comment was marked as off-topic.

This comment was marked as off-topic.

@colesbury colesbury force-pushed the autograd branch 4 times, most recently from fb7aacb to 98bda34 Compare February 9, 2017 20:18
@apaszke apaszke closed this Feb 11, 2017
@apaszke apaszke reopened this Feb 11, 2017

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

The core autograd Variable, Function, and Engine no longer depend on the
Python API. This let's us implement functions in C++. In the future, we
can also multithread engine and release the GIL for most of the
non-Python backwards.
@colesbury colesbury merged commit bd53030 into pytorch:master Feb 14, 2017
rohithkrn pushed a commit to rohithkrn/pytorch that referenced this pull request Jun 5, 2020
KyleCZH pushed a commit to KyleCZH/pytorch that referenced this pull request Sep 20, 2021
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.

3 participants