Skip to content

[C] Replace onnxsim to onnxslim and rm setup.cfg#27

Merged
kunkunlin1221 merged 3 commits into
mainfrom
feat/update_onnxsim_to_onnxslim
Aug 27, 2025
Merged

[C] Replace onnxsim to onnxslim and rm setup.cfg#27
kunkunlin1221 merged 3 commits into
mainfrom
feat/update_onnxsim_to_onnxslim

Conversation

@kunkunlin1221
Copy link
Copy Markdown
Collaborator

No description provided.

@kunkunlin1221 kunkunlin1221 self-assigned this Aug 27, 2025

This comment was marked as outdated.

@kunkunlin1221 kunkunlin1221 force-pushed the feat/update_onnxsim_to_onnxslim branch from fa4384a to 45862b5 Compare August 27, 2025 06:26
@kunkunlin1221 kunkunlin1221 force-pushed the feat/update_onnxsim_to_onnxslim branch 12 times, most recently from 7e70b23 to cf58ffa Compare August 27, 2025 08:06
@kunkunlin1221 kunkunlin1221 force-pushed the feat/update_onnxsim_to_onnxslim branch from cf58ffa to 5539ade Compare August 27, 2025 08:11
@kunkunlin1221 kunkunlin1221 requested a review from Copilot August 27, 2025 08:15
Copy link
Copy Markdown

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 replaces the onnxsim library with onnxslim for ONNX model optimization and removes the deprecated setup.cfg file in favor of pyproject.toml configuration. The changes also improve CI workflows and update test backend detection logic.

  • Replace dependency from onnxsim to onnxslim for ONNX model simplification
  • Remove setup.cfg and consolidate configuration in pyproject.toml
  • Add new backend detection functionality and improve test platform compatibility

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Updated dependency from onnxsim to onnxslim and improved package configuration
setup.cfg Removed deprecated configuration file
capybara/onnxengine/tools.py Replaced onnxsim.simplify() with onnxslim.slim() and added backend detection
capybara/onnxengine/enum.py New file defining Backend enum for consistent backend handling
capybara/onnxengine/engine.py Moved Backend enum to separate file and updated imports
tests/onnxruntime/test_engine*.py Updated test conditions to use new backend detection instead of platform checks
.github/workflows/*.yml Enhanced CI workflows with better platform support and updated actions
docker/*.dockerfile Updated base images and added new dependencies

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread tests/onnxruntime/test_engine.py
Comment thread capybara/onnxengine/tools.py
@kunkunlin1221 kunkunlin1221 added the enhancement New feature or request label Aug 27, 2025
@kunkunlin1221
Copy link
Copy Markdown
Collaborator Author

This pull request introduces significant improvements to the CI workflows, ONNX engine backend management, and dependency handling. The main changes include splitting and enhancing CI workflows for CPU and CUDA platforms, refactoring backend detection and selection logic for ONNX engines, updating dependencies and package metadata, and improving Dockerfile compatibility. These updates aim to increase platform flexibility, simplify backend usage, and ensure more robust package management.

CI Workflow Enhancements:

  • Added a new .github/workflows/cpu-ci.yml workflow for running CI on multiple platforms (Ubuntu and macOS) with both Python 3.10 and 3.12, including platform-specific prerequisite installation and test result surfacing.
  • Renamed and updated the CUDA workflow to .github/workflows/cuda-ci.yml, improved Python setup, added LFS checkout, and enhanced artifact cleanup and test result reporting. [1] [2] [3]

ONNX Engine Backend Refactoring:

  • Moved the Backend enum to a new module capybara/onnxengine/enum.py and refactored imports across ONNX engine files to use this new location, improving code organization and clarity. [1] [2] [3]
  • Added a new function get_recommended_backend() in capybara/onnxengine/tools.py to automatically select the best available backend based on runtime providers and device, streamlining backend selection. [1] [2]
  • Updated ONNX engine and IO binding logic to use the detected device type (CPU/GPU) dynamically, improving device compatibility and reducing hardcoded values. [1] [2]

Dependency and Packaging Updates:

  • Replaced onnxsim with onnxslim for model simplification in both code and dependencies, and updated the package name to capybara-docsaid in pyproject.toml. [1] [2]
  • Improved package discovery and exclusion logic in pyproject.toml for better build and distribution control.
  • Removed the legacy setup.cfg file to avoid redundancy and potential conflicts.

Dockerfile Improvements:

  • Updated base images in both docker/Dockerfile and docker/pr.dockerfile to Ubuntu 24.04 and added missing dependencies (git-lfs, libc6) for improved compatibility and build stability. [1] [2]

Test Suite Adjustments:

  • Refactored ONNX engine tests to use the new backend detection logic, ensuring tests run only on supported platforms and improving test reliability. [1] [2] [3] [4]

@kunkunlin1221 kunkunlin1221 merged commit aacfe58 into main Aug 27, 2025
9 checks passed
@kunkunlin1221 kunkunlin1221 deleted the feat/update_onnxsim_to_onnxslim branch August 27, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants