Skip to content

Topk ci tests#2

Merged
vlordier merged 3 commits intofix-pnnx-onnx-topk-supportfrom
topk-ci-tests
Apr 10, 2026
Merged

Topk ci tests#2
vlordier merged 3 commits intofix-pnnx-onnx-topk-supportfrom
topk-ci-tests

Conversation

@vlordier
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 10, 2026 11:42
@vlordier vlordier merged commit 2b5fa16 into fix-pnnx-onnx-topk-support Apr 10, 2026
3 checks passed
@vlordier vlordier deleted the topk-ci-tests branch April 10, 2026 11:42
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request consists of minor indentation and formatting adjustments across several files, including src/layer/topk.cpp, tools/pnnx/src/ir.cpp, and tools/pnnx/src/pass_onnx/fold_constants.cpp. I have no feedback to provide.

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

Adds a dedicated CI workflow intended to exercise TopK (and a related pnnx ONNX TopK test) across multiple Linux build configurations, along with minor formatting-only adjustments in a few C++ sources.

Changes:

  • Added a new GitHub Actions workflow to build and run test_topk under several x86/x64 feature configurations and run ctest -R test_onnx_torch_topk for pnnx.
  • Formatting-only indentation changes in pnnx ONNX constant folding and Python export code paths.
  • Indented OpenMP #pragma lines in TopK::forward().

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated 5 comments.

File Description
tools/pnnx/src/pass_onnx/fold_constants.cpp Formatting-only indentation change in op-type whitelist condition.
tools/pnnx/src/ir.cpp Formatting-only indentation changes in a few multi-line conditional blocks.
src/layer/topk.cpp Indented OpenMP pragmas (no functional change).
.github/workflows/topk-linux-test.yml New workflow to build/test TopK and run a pnnx ONNX TopK test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

on:
push:
branches:
- topk-ci-tests
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The on.push.branches list items are indented at the same level as the branches: key, which makes this workflow invalid YAML and prevents GitHub Actions from loading it. Indent the - topk-ci-tests entry under branches: (as done in other workflows) so the trigger is parsed correctly.

Suggested change
- topk-ci-tests
- topk-ci-tests

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +12
x64-none:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Each steps: block has its list items (- uses:, - name:, etc.) indented at the same level as the steps: key, which is invalid YAML. The list items need to be indented under steps: (e.g., two additional spaces) or the workflow will fail to parse.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +12
steps:
- uses: actions/checkout@v4
- name: build
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This workflow uses older GitHub Actions versions (actions/checkout@v4, actions/setup-python@v5) while the repository’s other workflows use actions/checkout@v6 and actions/setup-python@v6 (e.g., .github/workflows/linux-x64-cpu-gcc.yml:41, .github/workflows/pnnx.yml:45). Consider bumping to the repo-standard versions for consistency and latest security fixes.

Copilot uses AI. Check for mistakes.
push:
branches:
- topk-ci-tests

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Most workflows in this repo explicitly set minimal permissions (commonly contents: read). This workflow omits permissions, which can result in broader default token permissions depending on repo/org settings. Add an explicit permissions block to follow the repo’s security posture (see .github/workflows/linux-x64-cpu-gcc.yml:34-36).

Suggested change
permissions:
contents: read

Copilot uses AI. Check for mistakes.
on:
push:
branches:
- topk-ci-tests
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The workflow is configured to run only on push to the topk-ci-tests branch. If the intent is to run these TopK checks for PRs, you’ll need to add a pull_request trigger (and likely a paths filter like other workflows) so it runs when relevant files change on PRs to the main branch.

Suggested change
- topk-ci-tests
- topk-ci-tests
pull_request:
branches:
- main

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants