fep(sig-operator): add spacemit backend support for FlagGems#33
Open
alex-spacemit wants to merge 2 commits into
Open
fep(sig-operator): add spacemit backend support for FlagGems#33alex-spacemit wants to merge 2 commits into
alex-spacemit wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new FEP document describing SpacemiT backend enablement for FlagGems on FlagOS 2.1, including goals, integration details, and a basic validation test plan.
Changes:
- Introduces an FEP summarizing SpacemiT backend scope, operator coverage, and integration approach.
- Documents optional dependency behavior for
triton.backends.spine_tritonand device discovery viaspacemit-tcm-smi. - Adds setup/test instructions and references to related PRs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+19
to
+21
| - Adding SpacemiT runtime backend with operator implementations. | ||
| - Refactored the import structure and initialization logic for the SpacemiT backend. | ||
| Made the SpacemiT Triton configuration optional if triton.backends.spine_triton is unavailable, and added device detection via the spacemit-tcm-smi query command. |
Comment on lines
+79
to
+84
| | Category | Operators | Status | Notes | | ||
| |---|---|---|---| | ||
| | Exported forward-only operators | `argmax`, `argmin`, `bmm`, `bmm_out`, `global_avg_pool`, `mean_dim`, `mm`, `mm_out`, `mv`, `pow_scalar`, `pow_tensor_scalar`, `pow_tensor_scalar_`, `pow_tensor_tensor`, `pow_tensor_tensor_`, `rsqrt`, `where_scalar_other`, `where_scalar_self`, `where_self`, `where_self_out` | Enabled | Forward path is available; no backward/autograd registration | | ||
| | Exported operators with `torch.autograd.Function` integration | `layer_norm`, `silu` | Enabled | `layer_norm`: full forward/backward with weight/bias gradient kernels; `silu`: full forward/backward, also has in-place `silu_` (not exported) | | ||
| | Exported operators with separate backward function (no autograd.Function) | `gelu`, `softmax`, `sigmoid` | Enabled | `gelu`: supports `none` and `tanh` approximate modes, backward via `gelu_backward`; `softmax`: forward uses SpacemiT custom kernel (`softmax_kernel_spacemit`), backward delegates to `common_softmax_backward`; `sigmoid`: backward via `sigmoid_backward`, also has in-place `sigmoid_` (not exported) | | ||
| | Existing but not exported operator files | `addmm`, `conv1d`, `conv2d`, `conv_depthwise2d`, `flash_attention`, `thnn_conv2d` | Not exported | Operator files exist with full implementations, but imports/exports are commented out in `ops/__init__.py`. `conv1d` and `thnn_conv2d` are thin wrappers around `conv2d`; `conv_depthwise2d` delegates to `conv2d` with `groups`; `flash_attention` supports GQA, causal/non-causal modes, and `scaled_dot_product_attention`; `addmm` uses smt.dot with alpha/beta scaling | |
Comment on lines
+173
to
+175
| uv venv --python 3.12 .venv | ||
|
|
||
| source ./venv/bin/activate |
|
|
||
| Related PR: | ||
|
|
||
| - https://github.com/flagos-ai/FlagGems/pull/2527 — Add Spacemit runtime backend with operator implementations |
| - SpacemiT device query command is configured as `spacemit-tcm-smi`. | ||
|
|
||
| ## Related PRs | ||
| - https://github.com/flagos-ai/FlagGems/pull/2527 — Add Spacemit runtime backend with operator implementations |
| - Enable SpacemiT device query through `spacemit-tcm-smi`. | ||
| - Add setup support for SpacemiT. | ||
| - Use Python 3.12 for SpacemiT setup compatibility. | ||
| - Record initial validation result from `tests/test_abs.py`、`tests/test_mm.py`. |
| ``` | ||
|
|
||
| ### Expected Results | ||
| - `tests/test_abs.py`、`tests/test_mm.py` passes in the reported validation environment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.