Skip to content

[UIL] Add scalar IR API, on-device net construction, and per-peer staging fix#506

Merged
MC952-arch merged 20 commits into
flagos-ai:mainfrom
MC952-arch:device-ir-refactor
Jul 2, 2026
Merged

[UIL] Add scalar IR API, on-device net construction, and per-peer staging fix#506
MC952-arch merged 20 commits into
flagos-ai:mainfrom
MC952-arch:device-ir-refactor

Conversation

@MC952-arch

@MC952-arch MC952-arch commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

PR Category

UIL

PR Types

New Features

PR Description

This PR updates the Device IR / LLVM-IR-facing API surface by adopting explicit suffixes for the two calling styles: C-suffixed struct-based wrappers (existing path) and a new S-suffixed scalar, struct-free API intended for Triton/LLVM IR consumers. It also expands the device IR test coverage to exercise the new scalar entry points.

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the Device IR / LLVM-IR-facing API surface by adopting explicit suffixes for the two calling styles: C-suffixed struct-based wrappers (existing path) and a new S-suffixed scalar, struct-free API intended for Triton/LLVM IR consumers. It also expands the device IR test coverage to exercise the new scalar entry points.

Changes:

  • Renames existing IR wrapper entry points to C-suffixed symbols and updates kernels/tests accordingly.
  • Introduces scalar enums (flagcxCoopKind_t, flagcxTeamKind_t) and a new S-suffixed scalar IR API (+ implementation).
  • Extends the device IR unit test to add S1–S6 scalar IR kernel tests and updates exported IR symbol lists.

Reviewed changes

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

Show a summary per file
File Description
test/unittest/device_api/test_device_ir.cpp Adds scalar IR (S1–S6) test coverage and includes scalar results in overall pass/fail aggregation.
test/device_api/device_ir.h Declares scalar IR (S-suffixed) kernel launchers used by unit tests.
test/device_api/device_ir.cu Updates kernels to call renamed C-suffixed wrappers and adds scalar IR kernels exercising S APIs.
flagcx/adaptor/include/device_api/flagcx_device_enums.h Adds scalar enum types used by the S API to avoid struct instantiation in IR.
flagcx/adaptor/include/device_api/flagcx_device_core.h Exposes scalar enums via core header for shared native + IR integration.
bindings/ir/public_symbols.txt Updates exported symbol list to include C/S-suffixed APIs and scalar additions.
bindings/ir/flagcx_device_wrapper.h Renames wrapper declarations to C-suffixed names and adds API documentation/deprecation note.
bindings/ir/flagcx_device_wrapper_impl.h Renames wrapper implementations to C-suffixed names and includes scalar IR implementations.
bindings/ir/flagcx_device_scalar_ir.h Adds new struct-free scalar IR API declarations for Triton/LLVM IR users.
bindings/ir/flagcx_device_scalar_ir_impl.h Implements scalar IR APIs (coop/team/barrier/net) as inline device functions.

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

Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h Outdated
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h Outdated
Comment thread bindings/ir/flagcx_device_scalar_ir.h
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h Outdated
Comment thread flagcx/adaptor/include/device_api/flagcx_device_internal.h

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread flagcx/adaptor/flagcx_device.cc Outdated
Comment thread test/device_api/device_ir.cu Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread flagcx/adaptor/flagcx_device.cc
Comment thread flagcx/adaptor/flagcx_device.cc
Comment thread test/device_api/device_ir.cu

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread flagcx/adaptor/flagcx_device.cc Outdated
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread flagcx/adaptor/flagcx_device.cc
Comment thread bindings/ir/flagcx_device_scalar_ir_impl.h Outdated
Comment thread test/device_api/device_ir.h Outdated
Comment thread test/device_api/device_ir.cu Outdated
Comment thread test/unittest/device_api/test_device_ir.cpp Outdated
Comment thread test/device_api/device_ir.cu
Comment thread test/unittest/device_api/test_device_ir.cpp Outdated
Comment thread test/unittest/device_api/test_device_ir.cpp Outdated
Comment thread test/device_api/device_ir.cu
@MC952-arch MC952-arch requested a review from Copilot June 26, 2026 10:38
@MC952-arch MC952-arch changed the title [UIL] Rename Device IR APIs (C/S suffix), add docs, add scalar IR tests [UIL] Rename Device IR APIs (S-suffix), add docs, add scalar IR tests Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread flagcx/kernels/device_api_host_helpers.cu
@MC952-arch MC952-arch closed this Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread flagcx/adaptor/flagcx_device.cc Outdated
Comment thread bindings/ir/public_symbols.txt
Comment thread flagcx/kernels/device_api_host_helpers.cu

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comment thread flagcx/kernels/device_api_host_helpers.cu
@MC952-arch MC952-arch changed the title [UIL] Rename Device IR APIs (S-suffix), add docs, add scalar IR tests [UIL] Add scalar IR API, on-device net construction, and per-peer staging fix Jul 1, 2026
@MC952-arch MC952-arch force-pushed the device-ir-refactor branch from 42e904d to ffd1fd9 Compare July 1, 2026 10:44
@MC952-arch MC952-arch merged commit 9321b68 into flagos-ai:main Jul 2, 2026
16 checks passed
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