-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
【PIR API adaptor No.32】Migrate paddle.distribution.Uniform into pir #60322
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that 9d9d4e3's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@ooooo-create hi,这个pr的问题解决看起来还需要进行kernel迁移,请问一下这个PR你这边还有时间跟进吗,如果没有时间的话就让飞桨内部同学接手做啦 |
kernel 迁移是要怎么做呀,有时间想试试~ |
看了下代码,应该不涉及kernel迁移。需要做如下的修改:
if in_pir_mode():
return _C_ops.uniform_random_batch_size_like(xxx) |
def test_uniform_distribution_static(self, sample_shape=7, tolerance=1e-6): | ||
paddle.enable_static() | ||
with base.program_guard(self.test_program): | ||
def test_old_ir_uniform_distribution_static( |
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.
这里的修改是不是有点复杂了,原来的test_uniform_distribution_static函数是不是直接能用test_with_pir_api装饰器装饰一下复用呢?setUp函数内的self.test_program、self.executor、self.test_pir_program变量是不是直接在test_uniform_distribution_static函数内定义就可以了,别的地方也不会用到这几个变量,我们是不是也不需要InitDataContextManager这个class?单测的修改可以再斟酌一下~
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.
好的,修改了一下~
43: ERROR: test_uniform_distribution_static (test_distribution_uniform.UniformTest6)
443: ----------------------------------------------------------------------
443: Traceback (most recent call last):
443: File "/home/aistudio/Paddle/build/python/paddle/pir_utils.py", line 115, in impl
443: func(*args, **kwargs)
443: File "/home/aistudio/Paddle/build/test/distribution/test_distribution_uniform.py", line 133, in test_uniform_distribution_static
443: fetch_list = self.executor.run(
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 1764, in run
443: res = self._run_pir_impl(
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 2076, in _run_pir_impl
443: ) = self._executor_cache.get_pir_program_and_executor(
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 1110, in get_pir_program_and_executor
443: return self._get_cached_program_and_executor_pir_mode(
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 1139, in _get_pir_program_and_executor
443: new_exe = _StandaloneExecutor(place, plan, scope)
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 815, in __init__
443: self._new_exe = self._create_new_executor()
443: File "/home/aistudio/Paddle/build/python/paddle/base/executor.py", line 851, in _create_new_executor
443: new_exe = core.StandaloneExecutor(self._place, self._plan, self._scope)
443: RuntimeError: (PreconditionNotMet) op [pd_op.uniform_random_batch_size_like] kernel output args defs should equal op outputs
443: [Hint: Expected op_item->num_results() == output_defs.size(), but received op_item->num_results():1 != output_defs.size():0.] (at /home/aistudio/Paddle/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc:1813)
这个报错是关于kernel的吗
PR types
Others
PR changes
APIs
Description
link #58067
PIR API 推全升级
将 paddle.distribution.Uniform 迁移升级至 pir,并更新单测
单测覆盖率: 11/13