Skip to content

Conversation

@Deivanayaki-S
Copy link
Contributor

This PR adds support for the pad operation in Relax with handling for all common padding modes (constant, reflect, replicate, and circular). By adding this support, the following models are now able to run successfully:

  1. facebook/mask2former-swin-tiny-coco-instance (Image Segmentation)
  2. briaai/RMBG-2.0 (Background Removal)
  3. Intel/dpt-hybrid-midas (Depth Estimation)

@Deivanayaki-S
Copy link
Contributor Author

@tvm-bot rerun

1 similar comment
@Deivanayaki-S
Copy link
Contributor Author

@tvm-bot rerun

@github-actions
Copy link
Contributor

Failed to re-run CI in https://github.com/apache/tvm/actions/runs/14396550088

Details
Traceback (most recent call last):
  File "ci/scripts/github/github_tvmbot.py", line 591, in comment_failure
    raise item
  File "ci/scripts/github/github_tvmbot.py", line 697, in run
    pr.rerun_jenkins_ci()
  File "ci/scripts/github/github_tvmbot.py", line 550, in rerun_jenkins_ci
    post(url, auth=("tvm-bot", TVM_BOT_JENKINS_TOKEN))
  File "/home/runner/work/tvm/tvm/ci/scripts/jenkins/git_utils.py", line 53, in post
    with request.urlopen(req, data) as response:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway

with response

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

@Deivanayaki-S
Copy link
Contributor Author

@tvm-bot rerun

1 similar comment
@Deivanayaki-S
Copy link
Contributor Author

@tvm-bot rerun

@Deivanayaki-S Deivanayaki-S marked this pull request as ready for review April 15, 2025 10:36
@sidsingla
Copy link

I am just trying to convert pix2pix GAN model to TVM and came across this issue that currently no padding (ReflectionPad2d/ZeroPadding) is supported. Really thanks for this push and hope the change is pulled in soon.

@Deivanayaki-S
Copy link
Contributor Author

@Hzfengsy Could you please review this pr?

@Hzfengsy
Copy link
Member

cc @tlopex

@tlopex
Copy link
Member

tlopex commented Apr 17, 2025

LGTM! Thanks! @Deivanayaki-S
cc @Hzfengsy

@Hzfengsy
Copy link
Member

Please address the conflict :)

deivanayakisankaralingam added 3 commits April 18, 2025 03:44
fixing end of files formatting issue

fixing trailing space issues

update the docstring for pad mode in nn file

fixing lint issues

remove trailing whitespaces

fix lint format issues in test script

fix lint issue in pad file import statement

modify docstring of pad function

fixing dtype error in unity check

fixing lint issues in pad.py file

resolve arg mismatch error

resolved error while handling pad value attr

fix dtype of pad value attribute

add helper function for different pad mode

test script enhanced to check different pad mode

remove trailing whitespaces in test script

add docstring for helper function

update test script
@Deivanayaki-S
Copy link
Contributor Author

@Hzfengsy the conflict has been resolved. Thanks :)

@Hzfengsy Hzfengsy merged commit bf6e101 into apache:main Apr 18, 2025
10 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
…apache#17821)

* add pad op support into frontend pipelines

fixing end of files formatting issue

fixing trailing space issues

update the docstring for pad mode in nn file

fixing lint issues

remove trailing whitespaces

fix lint format issues in test script

fix lint issue in pad file import statement

modify docstring of pad function

fixing dtype error in unity check

fixing lint issues in pad.py file

resolve arg mismatch error

resolved error while handling pad value attr

fix dtype of pad value attribute

add helper function for different pad mode

test script enhanced to check different pad mode

remove trailing whitespaces in test script

add docstring for helper function

update test script

* fix pad op arg handling in fx graph

* fix issue by updated the retrieval of value arg

---------

Co-authored-by: deivanayakisankaralingam <deiva@Deivanayaki>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants