Skip to content

Enable tests by adding separate torchcodec-tests output [Debugging] #5

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

Closed
wants to merge 19 commits into from

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented Apr 24, 2025

As discussed in conda-forge/staged-recipes#29447 (comment) . The structure of using a separate (empty) torchcodec-tests output that only contains the (heavyweight) files used for tests is inspired from the torchvision-feedstock.

I also removed the manual pin of libtorch and pytorch to 2.6.* as now the global pinning are using 2.6, see conda-forge/conda-forge-pinning-feedstock#7208 .

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@traversaro
Copy link
Contributor Author

@conda-forge-admin, please rerender

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe/recipe.yaml) and found some lint.

Here's what I've got...

For recipe/recipe.yaml:

  • ❌ There are too few lines. There should be one empty line at the end of the file.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/14647613176. Examine the logs at this URL for more detail.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/recipe.yaml) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

@conda-forge-admin please rerender

@traversaro
Copy link
Contributor Author

This PR requires conda-forge/admin-requests#1501 to be merged for the CI to be green.

@traversaro traversaro closed this Apr 24, 2025
@traversaro traversaro reopened this Apr 24, 2025
@traversaro
Copy link
Contributor Author

Test on linux-aarch64 are failing (just the top of the output, the failure are much longer):

 │ + pytest test
 │ ============================= test session starts ==============================
 │ platform linux -- Python 3.13.3, pytest-8.3.5, pluggy-1.5.0
 │ rootdir: $SRC_DIR
 │ collected 308 items
 │ test/decoders/test_decoders.py .................FFssFFssFFsFs.s.sFsFsFFs [ 13%]
 │ Fs.s.s.sFsFs.s.sFsFsFsF.s.sFsFs.s.sFsFsFsFsFsFs..............sssssssssss [ 36%]
 │ sss..............ssssssssssssss.FFFsssFFFsss.s.s.sFs.                    [ 53%]
 │ test/decoders/test_metadata.py ........                                  [ 56%]
 │ test/decoders/test_ops.py FsFsFsFsFsFs.s.s.sFsFs.sFsFsFsFs.....FF.....FF [ 71%]
 │ FF...............s.......                                                [ 79%]
 │ test/samplers/test_policy.py .....                                       [ 81%]
 │ test/samplers/test_samplers.py ........FFFF............................. [ 94%]
 │ .......                                                                  [ 96%]
 │ test/samplers/test_video_clip_sampler.py ....                            [ 98%]
 │ test/test_frame_dataclasses.py .....                                     [ 99%]
 │ test/test_version.py .                                                   [100%]
 │ =================================== FAILURES ===================================
 │ ________________ TestVideoDecoder.test_getitem_int[exact-cpu-1] ________________
 │ self = <test.decoders.test_decoders.TestVideoDecoder object at 0x40005d6049d0>
 │ num_ffmpeg_threads = 1, device = 'cpu', seek_mode = 'exact'
 │     @pytest.mark.parametrize("num_ffmpeg_threads", (1, 4))
 │     @pytest.mark.parametrize("device", cpu_and_cuda())
 │     @pytest.mark.parametrize("seek_mode", ("exact", "approximate"))
 │     def test_getitem_int(self, num_ffmpeg_threads, device, seek_mode):
 │         decoder = VideoDecoder(
 │             NASA_VIDEO.path,
 │             num_ffmpeg_threads=num_ffmpeg_threads,
 │             device=device,
 │             seek_mode=seek_mode,
 │         )
 │     
 │         ref_frame0 = NASA_VIDEO.get_frame_data_by_index(0).to(device)
 │         ref_frame1 = NASA_VIDEO.get_frame_data_by_index(1).to(device)
 │         ref_frame180 = NASA_VIDEO.get_frame_data_by_index(180).to(device)
 │         ref_frame_last = NASA_VIDEO.get_frame_data_by_index(289).to(device)
 │     
 │ >       assert_frames_equal(ref_frame0, decoder[0])
 │ test/decoders/test_decoders.py:105: 

@traversaro
Copy link
Contributor Author

I am not sure if the failure is due to the emulation or due to linux-aarch64, I probably need to check on a physical linux-aarch64 machine.

@traversaro traversaro requested a review from Copilot April 25, 2025 12:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the CI configurations to enable tests with a separate torchcodec-tests output and removes redundant version pinning for libtorch and pytorch by aligning them with the global pin (set to 2.6). Key changes include:

  • Adding "libtorch" pin entries with version '2.6' across multiple YAML config files.
  • Adding "pytorch" pin entries with version '2.6' across the same configuration files.
  • Updating the Azure Pipelines matrix to reference the new cuda_compiler-based configuration names.

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.13.____cp313.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.12.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.11.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_versionNonepython3.10.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_version12.6python3.9.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_version12.6python3.13.____cp313.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_version12.6python3.12.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_version12.6python3.11.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_aarch64_cuda_compiler_version12.6python3.10.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_versionNonepython3.9.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_versionNonepython3.13.____cp313.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_versionNonepython3.12.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_versionNonepython3.11.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_versionNonepython3.10.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_version12.6python3.9.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_version12.6python3.13.____cp313.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_version12.6python3.12.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_version12.6python3.11.____cpython.yaml Added libtorch and pytorch version pins
.ci_support/linux_64_cuda_compiler_version12.6python3.10.____cpython.yaml Added libtorch and pytorch version pins
.azure-pipelines/azure-pipelines-linux.yml Updated matrix configuration keys to reference the new cuda_compiler-based configurations

@traversaro
Copy link
Contributor Author

As the linux-aarch64 builds are already available (and with similar failures), I do not think it make sense to block this PR on linux-aarch64 passing all tests, we can just merge by skipping tests on linux-aarch64, so that at least all the other architectures work.

@traversaro
Copy link
Contributor Author

As the linux-aarch64 builds are already available (and with similar failures), I do not think it make sense to block this PR on linux-aarch64 passing all tests, we can just merge by skipping tests on linux-aarch64, so that at least all the other architectures work.

Actually an attempt we can do is to try emulated builds instead of cross-compilation.

@traversaro
Copy link
Contributor Author

@conda-forge-admin please rerender

conda-forge-webservices[bot] and others added 2 commits April 25, 2025 13:04
@traversaro
Copy link
Contributor Author

@conda-forge-admin please rerender

@traversaro
Copy link
Contributor Author

The test failures are there also switching from cross-compilation to emulation, so they are probably not related to cross-compilation. They may be related to the emulation of tests, we should try to run them without emulation, and see if they fail also there. The same failures are there also on 0.3.0, see: #6 .

@traversaro
Copy link
Contributor Author

In 305374a I switched back to cross-compilation.

@traversaro
Copy link
Contributor Author

@conda-forge-admin please rerender

conda-forge-webservices[bot] and others added 2 commits April 27, 2025 14:10
@traversaro traversaro changed the title Enable tests by adding separate torchcodec-tests output Enable tests by adding separate torchcodec-tests output [Debugging] Apr 27, 2025
@traversaro
Copy link
Contributor Author

As this PR turned out to be more a debugging sandbox, I opened #7 for the PR for actually adding tests.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict. Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

@conda-forge-admin
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/recipe.yaml) and found it was in an excellent condition.

@traversaro
Copy link
Contributor Author

The test failures have been reproduced in https://github.com/traversaro/torchcodec-test-debug and reported in pytorch/torchcodec#569 (comment), so we can close this.

@traversaro traversaro closed this Apr 28, 2025
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.

2 participants