Skip to content

Make LinearHostIrTest.HostIrLinearOut less flaky#4001

Merged
wujingyue merged 1 commit intomainfrom
wjy/int
Mar 3, 2025
Merged

Make LinearHostIrTest.HostIrLinearOut less flaky#4001
wujingyue merged 1 commit intomainfrom
wjy/int

Conversation

@wujingyue
Copy link
Collaborator

@wujingyue wujingyue commented Mar 2, 2025

This had been broken consistently in CI although I couldn't reproduce the error. This PR seems to be able to fix it

@wujingyue
Copy link
Collaborator Author

!test

@wujingyue wujingyue changed the title less flaky Make LinearHostIrTest.HostIrLinearOut less flaky Mar 2, 2025
@github-actions
Copy link

github-actions bot commented Mar 2, 2025

Description

  • Replace random float tensors with random integer tensors

  • Improve test stability for HostIrLinearOut


Changes walkthrough 📝

Relevant files
Enhancement
test_host_irs.cpp
Replace random floats with integers in test                           

tests/cpp/test_host_irs.cpp

  • Changed at::randn to at::randint for input tensors
  • Set random integer range to 5 for consistency
  • +3/-3     

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🧪 PR contains tests
    ⚡ Recommended focus areas for review

    Randomness Consistency

    The use of randint with a fixed range (0-4) might not provide the same level of randomness as randn, which could affect the test's ability to catch certain edge cases or bugs.

    auto in_at = at::randint(5, {B, M, K}, options);
    auto weight_at = at::randint(5, {N, K}, options);
    auto bias_at = at::randint(5, {N}, options);

    @wujingyue wujingyue requested review from naoyam and zasdfgbnm March 3, 2025 00:12
    @wujingyue wujingyue merged commit 27258f5 into main Mar 3, 2025
    52 checks passed
    @wujingyue wujingyue deleted the wjy/int branch March 3, 2025 03:47
    @wujingyue wujingyue added the bug label Mar 3, 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