Skip to content

Commit

Permalink
Remove ROCM-specific stuff?
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Dec 2, 2024
1 parent 77f2e23 commit 1e3822c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,7 @@ def make_image_extension():
else:
warnings.warn("Building torchvision without JPEG support")

if USE_WEBP and IS_ROCM:
warnings.warn(
"Cannot enable webp support on rocm. "
"See https://github.com/pytorch/vision/pull/8724#issuecomment-2503964558."
)
elif USE_WEBP:
if USE_WEBP:
webp_found, webp_include_dir, webp_library_dir = find_library(header="webp/decode.h")
if webp_found:
print("Building torchvision with WEBP support")
Expand Down
4 changes: 0 additions & 4 deletions test/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
IS_MACOS = sys.platform == "darwin"
PILLOW_VERSION = tuple(int(x) for x in PILLOW_VERSION.split("."))
WEBP_TEST_IMAGES_DIR = os.environ.get("WEBP_TEST_IMAGES_DIR", "")
IS_ROCM = torch.version.hip is not None
# See https://github.com/pytorch/vision/pull/8724#issuecomment-2503964558
ROCM_WEBP_MESSAGE = "ROCM not built with webp support."

Expand Down Expand Up @@ -872,7 +871,6 @@ def test_decode_gif(tmpdir, name, scripted):
(decode_jpeg, "Not a JPEG file"),
(decode_gif, re.escape("DGifOpenFileName() failed - 103")),
(decode_webp, "WebPGetFeatures failed."),
pytest.param(decode_webp, "WebPGetFeatures failed.", marks=pytest.mark.skipif(IS_ROCM, reason=ROCM_WEBP_MESSAGE)),
]
if DECODE_AVIF_ENABLED:
decode_fun_and_match.append((_decode_avif, "BMFF parsing failed"))
Expand All @@ -893,7 +891,6 @@ def test_decode_bad_encoded_data(decode_fun, match):
decode_fun(encoded_data)


@pytest.mark.skipif(IS_ROCM, reason=ROCM_WEBP_MESSAGE)
@pytest.mark.parametrize("decode_fun", (decode_webp, decode_image))
@pytest.mark.parametrize("scripted", (False, True))
def test_decode_webp(decode_fun, scripted):
Expand All @@ -910,7 +907,6 @@ def test_decode_webp(decode_fun, scripted):
# including within the repo. The test images were downloaded manually from the
# different pages of https://developers.google.com/speed/webp/gallery
@pytest.mark.skipif(not WEBP_TEST_IMAGES_DIR, reason="WEBP_TEST_IMAGES_DIR is not set")
@pytest.mark.skipif(IS_ROCM, reason=ROCM_WEBP_MESSAGE)
@pytest.mark.parametrize("decode_fun", (decode_webp, decode_image))
@pytest.mark.parametrize("scripted", (False, True))
@pytest.mark.parametrize(
Expand Down

0 comments on commit 1e3822c

Please sign in to comment.