CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT][NumPy] Complete the basic procedure #72154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
整体应该没啥大风险
python/paddle/jit/sot/opcode_translator/executor/function_graph.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/function_graph.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/function_graph.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/callable.py
Outdated
Show resolved
Hide resolved
Co-authored-by: 0x3878f <37301539+0x3878f@users.noreply.github.com>
const std::vector<std::optional<int64_t>>& shape) | ||
: expected_(shape) {} | ||
|
||
explicit NumPyArrayShapeMatchGuard(const std::vector<py::object>& shape) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是最多只需要支持两种初始化方式
直接传入一个 np.array (由于一些编译原因,得传py::object
转一下)- 在 python 直接
.shape
, 传的是一个tuple[int]
,也就是std::vector<py::int_>
或者初始化为py::tuple
,这样()
和(2,)
都能覆盖到
python/paddle/jit/sot/opcode_translator/executor/variables/callable.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/variables/basic.py
Outdated
Show resolved
Hide resolved
python/paddle/jit/sot/opcode_translator/executor/function_graph.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DCU 和 Windows openblas 的报错试一下给 但针对于此 case,我们应该参考 另外,后续单独提一个 PR 把所有 sot 目录里的 |
好的 |
|
PR Category
Execute Infrastructure
PR Types
Improvements
Description
Run the example shown below successfully, which indicates that we have established the basic process for supporting
NumPy
operations with Paddle SOT.To support it, we add a new variable named
NumpyApiVariable
, which records original NumPy API.During the simulation process, when calling a NumPy API, we use a Paddle API instead to achieve the same functionality.
TODO
pcard-67164