onnx / onnx/models

BidAF weird shapes around Compress operator

Open
#170 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
9.8k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

First of all, thanks @KeDengMS for the work on the BidAF model, it is a great addition to the zoo-as-a-test-suite.

I'm struggling a bit trying to get it through tract. I think there may be an encoding error that some backend implementation chose to ignore silently at the very end. Unless I'm missing something, of course.

248 PermuteAxes Transpose_22
  * input fact  #0: 245/0> 87x1xF32
  * output fact #0: 1x87xF32
249 LayerHardmax Hardmax_23
  * input fact  #0: 248/0> 1x87xF32
  * output fact #0: 1x87xF32
250 Cast Cast_24
  * input fact  #0: 249/0> 1x87xF32
  * output fact #0: 1x87xBool
  * Attr to: name: "to" type: INT i: 9
253 onnx.Compress Compress_27
  * input fact  #0: 252/0> 1x87xI32
    input fact  #1: 250/0> 1x87xBool
  * output fact #0: 1xI32 MODEL OUTPUT

According to its specification, onnx compress second input is supposed to be of rank 1, and I think we get a 2D input here. It comes from a Transpose -> HardMax -> Cast sequence.

As far as I can tell HardMax is not supposed to change the shape either, and Transpose definitely hints at a 2D output, so...

Any help appreciated.

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 inspecting the BidAF model graph around Transpose_22, Hardmax_23, Cast_24, and Compress_27, then compare the tensor ranks with the ONNX Compress specification. Determine whether the rank mismatch is present in the model encoding and document or correct the model so the graph conforms to the specification and tract can process it.

Written by the indexing model from the issue text.

Assessment

Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.