mindspore-ai / mindspore-ai/hyper-parallel

add dense_lightning_indexer_grad_klloss and other custom ops

Open
#316 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
63
Avg merge
23h 45m
Merged PRs (30d)
63

Description

添加npu_dense_lightning_indexer_grad_klloss,npu_dense_lightning_indexer_softmax_lse, npu_sparse_lightning_indexer_grad_klloss 三个自定义接入算子。支持pynative模式。
接口对标pta。

def npu_dense_lightning_indexer_grad_kl_loss(
        query,
        key,
        query_index,
        key_index,
        weights,
        softmax_max,
        softmax_sum,
        softmax_max_index,
        softmax_sum_index,
        scale_value,
        query_rope=None,
        key_rope=None,
        actual_seq_qlen=None,
        actual_seq_klen=None,
        layout=None,
        sparse_mode=None,
        pre_tokens=None,
        next_tokens=None)
      
    def npu_dense_lightning_indexer_softmax_lse(
        query_index,
        key_index,
        weight,
        actual_seq_qlen=None,
        actual_seq_klen=None,
        layout=None,
        sparse_mode=None,
        pre_tokens=None,
        next_tokens=None)
        
    def npu_sparse_lightning_indexer_grad_kl_loss(
        query,
        key,
        query_index,
        key_index,
        weights,
        sparse_indices,
        softmax_max,
        softmax_sum,
        scale_value,
        query_rope=None,
        key_rope=None,
        actual_seq_qlen=None,
        actual_seq_klen=None,
        layout=None,
        sparse_mode=None,
        pre_tokens=None,
        next_tokens=None)
    ```

<!-- bot3-issue-meta -->
schema_version: 1
source: gitcode
gitcode_repo: mindspore/hyper-parallel
gitcode_issue: 97
source_url: https://gitcode.com/mindspore/hyper-parallel/issues/97
<!-- /bot3-issue-meta -->

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing PTA counterparts and the project's custom-operator registration or entry points. Compare their interfaces with the three signatures in the issue, then determine how PyNative support is handled. Done means all three NPU operators are registered with PTA-compatible behavior and PyNative support.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.