microsoft / microsoft/onnxruntime

[Documentation] Attention Contrib Op Bias argument Not optional?

Open
#25,005 3 comments 0 reactions 0 assignees View on GitHub
documentation ep:MIGraphX ep:ROCm
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the documentation issue

Looking for some clarification on this one

Currently adding MIGraphX parser support for your Attention operator in with the intent to make it MIGraphX IR
https://github.com/ROCm/AMDMIGraphX/pull/3816

OP in question
https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#commicrosoftattention

I'm running into an issue when running onnx models generated that use the attention operator found in the Microsoft Contrib operator set segfault on CPU EP

It appears bias for the input projection is stated as an optional argument but I continually get segmentation faults through a run through OnnxRT CPU execution provider when I attempt to run a reduce model with minimum inputs (Input, Weights, Num_heads)

I've written a test in MIGraphX which was intended to test the min scale-dot attention head (set num_heads=1) and ensure the calculation maintains accuracy. I'm able to run things through MIGraphX but the issue only appears when things run through the EP

There's nothing that is clear in the attention_base.cc/.h files on inputs, and all I see that's required outside of input, and weights, and num_heads. Num_heads uses an ORT_ENFORCE() for the attribute, but is there something you set for required inputs in your operators?

All my other test seem to work correctly as long as bias is included in the input list. Is this an error or is there a change in documentation and the bias input is now required?

I can point you to the generated files to reproduce if this is a bug. We have a way to check accuracy on MIGraphX and compare between MIGraphX IR, CPU runs and other sources.

cc @tianleiwu

### Page / URL

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked docs/ContribOperators.md entry for com.microsoft.Attention and inspect the referenced attention_base.cc/.h files. Reproduce the minimal CPU execution-provider case with input, weights, and num_heads, then compare it with the MIGraphX test and the bias-present case. Done means clarifying whether bias is optional or required, and documenting or reporting the confirmed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.