Repository navigation
【PIR API adaptor No.51, 60】Migrate some ops into pir - #58684
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
Sorry to inform you that 3157aa1's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
|
麻烦 merge 一下最新的分支~ |
| def test_check_output(self): | ||
| self.check_output(check_dygraph=False) | ||
| self.check_output(check_dygraph=False, check_pir=True) | ||
|
|
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
done |
This comment was marked as resolved.
This comment was marked as resolved.
MarioLulab
left a comment
There was a problem hiding this comment.
- deform_conv2d 还缺少 test/legacy_test/test_deformable_conv_op.py 和 test/legacy_test/test_deformable_conv_v1_op.py 文件里相关单测的适配
- distribute_fpn_proposals 还缺少 test/legacy_test/test_detection.py 文件里相关单测的适配
|
|
||
| self.mask = np.random.uniform(-1, 1, self.mask_shape).astype(self.dtype) | ||
|
|
||
| @test_with_pir_api |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| self.mask = np.random.uniform(-1, 1, self.mask_shape).astype(self.dtype) | ||
|
|
||
| @test_with_pir_api |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| class TestModulatedDeformableConvInvalidInput(unittest.TestCase): | ||
| @test_with_pir_api | ||
| def test_error(self): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
|
|
||
| class TestDeformConv2DAPI(unittest.TestCase): | ||
| @test_with_pir_api |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| for res_stat, res_dy in zip(output_stat_np, output_dy_np): | ||
| np.testing.assert_array_equal(res_stat, res_dy) | ||
|
|
||
| @test_with_pir_api |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
|
||
|
|
||
| class TestMulticlassNMS2(unittest.TestCase): | ||
| @test_with_pir_api |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| base.default_main_program().random_seed = self.seed | ||
| yield | ||
|
|
||
| @test_with_pir_api |
|
|
||
| @test_with_pir_api | ||
| def static_generate_proposals( | ||
| self, scores_np, bbox_deltas_np, im_info_np, anchors_np, variances_np |
There was a problem hiding this comment.
这里是适配的原因是?该单测并没有测试 distribute_fpn_proposals
| ) | ||
| return rois_stat, roi_probs_stat, rois_num_stat | ||
|
|
||
| def dynamic_generate_proposals( |
| rois_num_dy = rois_num.numpy() | ||
| return rois_dy, roi_probs_dy, rois_num_dy | ||
|
|
||
| def test_generate_proposals(self): |
MarioLulab
left a comment
There was a problem hiding this comment.
nice work !
还有一些地方需要修改
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| y_v1 = paddle.vision.ops.deform_conv2d( | ||
| input=x, | ||
| offset=offset, | ||
| mask=None, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| ) | ||
|
|
||
| y_v2 = paddle.static.nn.common.deformable_conv( | ||
| y_v2 = paddle.vision.ops.deform_conv2d( |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| y_v1 = paddle.vision.ops.deform_conv2d( | ||
| input=x, | ||
| offset=offset, | ||
| mask=None, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| y_v2 = paddle.static.nn.common.deformable_conv( | ||
| y_v2 = paddle.vision.ops.deform_conv2d( | ||
| input=x, | ||
| offset=offset, |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| def setUp(self): | ||
| self.python_api = deform_conv2d_wrapper | ||
| self.op_type = "deformable_conv" | ||
| self.op_type = "deform_conv2d" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
|
||
| class TestDeformConv2DAPI(unittest.TestCase): | ||
| @test_with_pir_api | ||
| def test_api(self): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| class TestDeformConv2DError(unittest.TestCase): | ||
| def test_input_error(self): | ||
| @test_with_pir_api | ||
| def test_input_rank_error(): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
done |
MarioLulab
left a comment
There was a problem hiding this comment.
paddle.vision.ops.deform_conv2d 需要输入 weight 参数。麻烦再仔细检查一下入参是否正确吧~ deform_conv2d 的迁移比较麻烦,最好用本地环境先测试一下
| def test_distribute_fpn_proposals(self): | ||
| rois_np = np.random.rand(10, 4).astype('float32') | ||
| rois_num_np = np.array([4, 6]).astype('int32') | ||
| @test_with_pir_api |
There was a problem hiding this comment.
@test_with_pir_api 应该用来修饰下面的 test_distribute_fpn_proposals,test_distribute_fpn_proposals 才是用来进行结果比较的
哈哈好的,很久没编译了,周末再来调试下~ |
long 师傅最近编译了吗 ~ 如果没有的话 deform_conv2d 的适配就由我来做吧 |
好的 |
|
deform_conv2d 的 pir 适配将会在此 pr 里推进 #60168 |
|
辛苦解决一下冲突~ |
|
done |
MarioLulab
left a comment
There was a problem hiding this comment.
LGTM
decode_jpeg api 已在 #58955 里完成适配,麻烦更新一下当前 pr 的单测覆盖率和 pr 标题吧~
PR types
Others
PR changes
APIs
Description
PIR API 推全升级
将如下算子迁移升级至 pir,并更新单测
目前继承自 OpTest 的单测,在 pir 模式下暂不支持设置输入的 lod_level,因此TestDistributeFPNProposalsOp等三个单测可以先跳过
test_detection.py里的test_error 性质的单测目前暂时无法适配
新IR Python API适配升级 #58067