forked from triton-lang/triton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecation of Triton-C and Replacement by decorated Python functions (…
…triton-lang#86) This PR implements a major overhaul of the frontend for Triton, and replaces Triton-C by a pure Python API in which kernels are defined as @triton.jit decorated functions. The documentation and tutorials have also been updated to accommodate these changes. See documentations for more information on the new API
- Loading branch information
Showing
91 changed files
with
4,492 additions
and
13,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
Python API | ||
=========== | ||
|
||
.. currentmodule:: triton | ||
|
||
|
||
Programming Model | ||
------------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
program_id | ||
num_programs | ||
|
||
|
||
Creation Ops | ||
------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
arange | ||
zeros | ||
|
||
|
||
Shape Manipulation Ops | ||
----------------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
broadcast_to | ||
reshape | ||
ravel | ||
|
||
|
||
|
||
Linear Algebra Ops | ||
------------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
dot | ||
|
||
Memory Ops | ||
-------------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
load | ||
store | ||
atomic_cas | ||
atomic_xchg | ||
|
||
|
||
Indexing Ops | ||
-------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
where | ||
|
||
|
||
Math Ops | ||
---------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
exp | ||
log | ||
sigmoid | ||
softmax | ||
|
||
|
||
Reduction Ops | ||
--------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
max | ||
min | ||
sum | ||
|
||
|
||
Comparison ops | ||
--------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
minimum | ||
maximum | ||
|
||
|
||
Compiler Hint Ops | ||
------------------- | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
:nosignatures: | ||
|
||
multiple_of |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
#ifndef _TRITON_CODEGEN_PASS_H_ | ||
#define _TRITON_CODEGEN_PASS_H_ | ||
|
||
#include <list> | ||
|
||
#include <memory> | ||
|
||
namespace triton{ | ||
|
||
namespace ir{ | ||
class module; | ||
} | ||
namespace driver{ | ||
class device; | ||
class module; | ||
class kernel; | ||
} | ||
} | ||
|
||
namespace triton{ | ||
namespace codegen{ | ||
|
||
class pass { | ||
public: | ||
virtual void run(ir::module& m); | ||
}; | ||
|
||
// TODO: | ||
// There should be a proper pass manager there! | ||
void add_passes_to_emit_bin(ir::module &ir, driver::device* dev, int num_warps, | ||
driver::module*& mod, driver::kernel*& ker, size_t& shared_mem); | ||
|
||
class pass_manager { | ||
public: | ||
void add(pass* p); | ||
void run(ir::module& m); | ||
|
||
private: | ||
std::list<pass*> passes; | ||
}; | ||
|
||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.