cosdt / torch_backend

https://cosdt.github.io/torch_backend/
Other
3 stars 0 forks source link

PyTorch Backend

Project Objective (Implementation of PyTorch RFC 37):

Current Progress:

Next Steps:


Getting Started

To start using the PyTorch Backend Project, users can refer to the comprehensive documentation provided. This includes detailed guides on setting up the environment, integrating new devices, and best practices for optimizing performance.

Project Structure

    .
    ├── backends
    │   ├── fake               // dummy backend: provide all weak symbols needed by csrc, we can run this demo without implementing all symbols in REAL Backend by this fake backend.
    │   ├── npu                // one of REAL Backend: provide API and Structure related witch specific Backends strongly
    │   ├── cuda               // one of REAL Backend: will be implemented later
    │   └── ...
    ├── cmake
    ├── codegen                // Code generation: includes registration for forward and backward, backward implementation, backward binding, custom operator routing, reroute routing, etc.
    │   ├── autograd
    │   │   └── templates      // General template
    │   └── templates
    ├── csrc                   // C++ implementations related to PyTorch, not involving specific backend implementations, theoretically only includes backend interface calls
    │   ├── api                // libtorch functionalities
    │   ├── aten               // Code generation: includes only wrap and PyTorch operator registration; in the future, considering moving Tensor & Storage & Serialization here, as these three are related to Tensor logic
    │   ├── backend            // General Implementation of PyTorch API
    │   ├── core               // Common Utils
    │   │   ├── allocator
    │   │   ├── generator
    │   │   └── guard
    │   └── distributed        // Distributed
    ├── docs                   // All docs: C++ API, Python API and E2E tutorials
    │   ├── cpp
    │   │   └── source
    │   └── source
    ├── test                   // General TestCase Sets: including C++ and python
    │   └── cpp
    │       ├── backend
    │       ├── common
    │       └── core
    ├── third_party
    │   └── googletest
    └── torch_backend          // Python interface implementation for PyTorch
        ├── backend
        ├── csrc               // Python & C++ binding
        │   ├── backend        // Python bindings for all low-level capabilities needed to be exposed to Python
        │   └── core           // General capabilities, only provided for Python
        └── meta               // Meta operator registration

Documents

API Documents

C++ API

License

PyTorch Backend has a BSD-style license, as found in the LICENSE file.