Skip to content

ci: separate extra installs#622

Open
begumcig wants to merge 9 commits intomainfrom
ci/separate-extra-installs
Open

ci: separate extra installs#622
begumcig wants to merge 9 commits intomainfrom
ci/separate-extra-installs

Conversation

@begumcig
Copy link
Copy Markdown
Member

@begumcig begumcig commented Apr 8, 2026

Description

  • Isolated whisper dependencies into a dedicated [whisper] extra. Moved ctranslate2 and whisper-s2t out of the default full install group into [whisper] to prevent side-effects from whisper_s2t imports breaking unrelated tests at collection time. The previously hard-skipped TestWhisperS2T is now gated behind requires_whisper instead.

  • Pin torch/torchvision bounds on the [intel] extra. intel-extension-for-pytorch is tightly coupled to the torch version; added explicit torch>=2.7.0,<2.9.0 and torchvision>=0.22.0,<0.24.0 constraints so installs don't silently break.

  • Also switch TestIPEXLLM to use opt_125m model and drop latency metric. The algorithm didn't work on a tiny model due to latent size being small; we also need a specific inference handler for it for the metrics, which can be done later, so removed the evaluation part for now.

  • IPEX is strictly coupled with the torch version and is not maintained. So makes sense to run it in the nightlies but not on the CI, as it requires its own setup.

  • Declared packaging conflicts between intel/awq and gptq/awq. These extras pull in incompatible transitive deps; the new [tool.uv.conflicts] entries surface the error at resolve time instead of runtime.

  • Added requires_* markers for optional-extra tests. New markers requires_awq, requires_gptq, requires_stable_fast, requires_vllm, requires_intel, requires_lmharness, and requires_whisper let CI select/deselect tests based on what's installed rather than relying on implicit skips or collection errors.

  • Removed the old HIGH_RESOURCE_FIXTURES list and runtime CUDA/multi-GPU detection. Tests without an explicit hardware mark are now auto-tagged cpu. Incompatible device_parametrized variants (e.g. a CUDA-only algorithm's CPU test) are deselected at collection time instead of skipping after expensive fixture setup. Added explicit pytestmark = pytest.mark.cpu to pure-CPU test modules (test_compatibility_symmetry, test_evalharness_metrics, test_registry, test_metrics) so they're correctly selected by -m "cpu".

  • Updated CI workflow. Dropped --extra vllm from the default uv sync in the setup action. Changed the pytest filter from -m "not (slow or style or high_cpu or cuda or distributed)" to the positive-selection form -m "cpu and not slow and not requires_intel".

Related Issue

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (no functional change)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I added or updated tests covering my changes
  • Existing tests pass locally (uv run pytest -m "cpu and not slow")

For full setup and testing instructions, see the Contributing Guide.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code, especially for agent-assisted changes
  • I updated the documentation where necessary

Thanks for contributing to Pruna! We're excited to review your work.

New to contributing? Check out our Contributing Guide for everything you need to get started.

Note:

  • Draft PRs or PRs without a clear and detailed overview may be delayed.
  • Please mark your PR as Ready for Review and ensure the sections above are filled out.
  • Contributions that are entirely AI-generated without meaningful human review are discouraged.

First Prune (1-year OSS anniversary)

First Prune marks one year of Pruna’s open-source work. During the initiative window, qualifying merged contributions count toward First Prune. You can earn credits for our performance models via our API.

If you’d like your contribution to count toward First Prune, here’s how it works:

  • Initiative window: First Prune starts on March 31.
  • Issue assignment: For your PR to count toward First Prune, the related issue must be assigned to the contributor opening the PR. Issues are labeled with first-prune.
  • Open for review: Please open your PR and mark it ready for review by April 30 (end of April).
  • Review priority: We’ll make our best effort to review quickly any PR that is open and has a review request before April 30.
  • Credits: Each qualifying merged PR earns 30 credits. We’ll be in touch after all qualifying PRs for First Prune have been merged.
  • To get started: Have a look at all models. You’ll need to sign up on the dashboard before you can redeem your credits.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 8, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@begumcig begumcig force-pushed the ci/separate-extra-installs branch 2 times, most recently from 15f808b to 790b58a Compare April 8, 2026 14:34
@begumcig begumcig force-pushed the ci/separate-extra-installs branch from 790b58a to b72e644 Compare April 8, 2026 14:47
@begumcig begumcig force-pushed the ci/separate-extra-installs branch from b72e644 to 2202c07 Compare April 8, 2026 14:58
@begumcig begumcig force-pushed the ci/separate-extra-installs branch 2 times, most recently from 437aac1 to 298914e Compare April 9, 2026 08:42
@begumcig begumcig force-pushed the ci/separate-extra-installs branch from 298914e to 026073c Compare April 9, 2026 11:09
@begumcig begumcig requested a review from gsprochette April 9, 2026 11:38
Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

Thanks for this absolute gold PR. Already super good, I left some comments for little improvements here and there, almost ready already


- shell: bash
run: uv sync --extra dev --extra lmharness --extra vllm
run: uv sync --extra dev --extra lmharness
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why are we still installing lmharness? Shouldn't it be isolated as well?

run: |
echo "Running tests with up to 3 reruns on failure using $PYTEST_WORKERS workers..."
uv run pytest -n $PYTEST_WORKERS -m "not (slow or style or high_cpu or cuda or distributed)" --reruns 3 --reruns-delay 10 --maxfail=1
uv run pytest -n $PYTEST_WORKERS -m "cpu and not slow and not requires_intel" --reruns 3 --reruns-delay 10 --maxfail=1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this will run the style tests a second time, since they are already running during the linting job line 56



@pytest.mark.slow
@pytest.mark.requires_awq
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is it not slow anymore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i thought slow was a wrong tag here, as awq is not time intensive like gptq for instance, but how do you feel?


@pytest.mark.cuda
# Takes too long to run on CPU, so we mark it as slow
@pytest.mark.slow
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You could also do something like

    @classmethod
    def compatible_devices(cls) -> list[str]:  # type: ignore[override]
        """Get the devices compatible with this algorithm, except CPU (too slow)."""
        return [d for d in super().compatible_devices() if d != "cpu"]

if the intent is to not run this test on cpu.
I do agree that the cuda mark is not the correct tool because it will just create a cpu test eitherway, and it will have both the cpu and cuda mark...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need the slow thing now do we? maybe we still want it or maybe it should be a comment stating why we ignore the cpu case... I'll let you decide

from pruna.evaluation.metrics.metric_base import BaseMetric
from pruna.evaluation.metrics.registry import MetricRegistry

pytestmark = pytest.mark.cpu
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is redundant with the cpu default in conftest.py and not very explicit

set_opentelemetry_log_level,
)

pytestmark = pytest.mark.cpu
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is redundant with the cpu default in conftest.py, and not very explicit

# Intel extension is tightly coupled with the torch version
intel = [
"intel-extension-for-pytorch>=2.7.0",
"torch>=2.7.0,<2.9.0",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I get that it's tightly coupled with torch, but if intel-extension already declares it's torch dependency we shouldn't need to declare it here no? Same goes for torchvision

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see what you mean and I softly disagree. yes the version already defines which torch version it's supposed to use, but it doesn't define it in its dependencies. same for the torchvision version. So someone could install ipex with the absolutely wrong torch stack and get really cryptic errors. I think it's better to be explicit here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ah, if the torch version is not in the package dependency then absolutely let's pin torch so that the intel install works

@begumcig begumcig requested a review from gsprochette April 10, 2026 13:51
Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

Looks great, let's merge it ! I just left one comment for you to decide about the "slow" mark on upscale :) 💅


@pytest.mark.cuda
# Takes too long to run on CPU, so we mark it as slow
@pytest.mark.slow
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need the slow thing now do we? maybe we still want it or maybe it should be a comment stating why we ignore the cpu case... I'll let you decide

@gsprochette gsprochette self-requested a review April 10, 2026 14:07
Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

Meant to approve, please refer to previous comment 🙃

@begumcig begumcig force-pushed the ci/separate-extra-installs branch from 58db272 to c7e5727 Compare April 10, 2026 14:50
@begumcig begumcig force-pushed the ci/separate-extra-installs branch from c7e5727 to 8292c33 Compare April 10, 2026 14:55
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