Skip to content

Fix MacOS torch multiprocessing permission issue#13709

Open
Y-T-G wants to merge 2 commits intomasterfrom
torch-macos-ci
Open

Fix MacOS torch multiprocessing permission issue#13709
Y-T-G wants to merge 2 commits intomasterfrom
torch-macos-ci

Conversation

@Y-T-G
Copy link
Copy Markdown
Contributor

@Y-T-G Y-T-G commented Feb 10, 2026

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Fixes macOS CI failures caused by PyTorch multiprocessing permission/quarantine restrictions by adding a dedicated workflow step. 🛠️🍎

📊 Key Changes

  • Adds a macOS-only GitHub Actions step in .github/workflows/ci-testing.yml to relax Gatekeeper and quarantine restrictions
  • Recursively clears com.apple.quarantine attributes from the installed torch package directory
  • Ensures torch_shm_manager is executable to prevent multiprocessing runtime errors

🎯 Purpose & Impact

  • Improves reliability of macOS CI runs when importing/using torch with multiprocessing
  • Reduces flaky/blocked test runs caused by OS security/quarantine behavior on CI runners
  • May have security implications by disabling certain macOS protections on CI runners (scoped to CI, macOS-only)

Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
@UltralyticsAssistant UltralyticsAssistant added bug Something isn't working devops GitHub Devops or MLops fixed Bug has been resolved labels Feb 10, 2026
@UltralyticsAssistant
Copy link
Copy Markdown
Member

👋 Hello @Y-T-G, thank you for submitting a ultralytics/yolov5 🚀 PR! This is an automated message, and an Ultralytics engineer will assist you shortly. 🧪🍎

-✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
-✅ Synchronize with Source: Confirm your PR is synchronized with the ultralytics/yolov5 main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
-✅ Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
-✅ Update Documentation: Update the relevant documentation for any new or modified features.
-✅ Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
-✅ Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
-✅ Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

Copy link
Copy Markdown
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

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

🔍 PR Review

Made with ❤️ by Ultralytics Actions

Overall clean change and well-scoped to macOS CI. One potential robustness issue: the new chmod (and import) can fail when torch_shm_manager isn’t present, which could break macOS runs.

💬 Posted 1 inline comment

Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
Copy link
Copy Markdown
Member

@UltralyticsAssistant UltralyticsAssistant left a comment

Choose a reason for hiding this comment

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

🔍 PR Review 2

Made with ❤️ by Ultralytics Actions

Overall looks good and targeted to macOS CI stability. Only concern is making the chmod step resilient to torch builds that don’t include torch_shm_manager.

💬 Posted 1 inline comment

@Y-T-G
Copy link
Copy Markdown
Contributor Author

Y-T-G commented Feb 10, 2026

@Laughing-q MacOS security blocks torch for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working devops GitHub Devops or MLops fixed Bug has been resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants