question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace scatter operations in TAPAS by native PyTorch

See original GitHub issue

Feature request

TAPAS (my first 🤗 contribution 😄 ) still relies on the torch_scatter library, as the model uses some scatter operations on tensors. Back then PyTorch didn’t have these operations available.

Now they have: https://pytorch.org/docs/stable/generated/torch.Tensor.scatter_.html#torch.Tensor.scatter_.

So we should replace this line by native PyTorch.

To confirm everything is working fine, one should run the following tests and make sure they pass (to be run from the root of this repository):

RUN_SLOW=yes pytest tests/models/tapas/test_modeling_tapas.py

Subsequently, all is_scatter_available mentions can be removed from the code base.

Motivation

By replacing this, our TAPAS implementation doesn’t rely on a third-party library anymore.

Your contribution

I can look into this, but marking it as a good first/second issue.

Update: I have an attempt here: https://github.com/huggingface/transformers/compare/main...NielsRogge:transformers:fix_tapas_scatter?expand=1.

However, training tests didn’t pass due to an issue in the backward pass.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ydshiehcommented, Nov 15, 2022

Yes, thanks for reminding us 😃 @Bearnardd

Closed by #20149

1reaction
ydshiehcommented, Nov 8, 2022

@Bearnardd Thank you!

You can start from this (updated) branch/PR (which is updated with the main branch with a tiny fix). If you want to start from @NielsRogge branch, you have to rebase on (updated) main first - there will be a few conflicts to resolve.

https://github.com/huggingface/transformers/pull/20107 https://github.com/huggingface/transformers/tree/fix_tapas_scatter

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError: Function 'PowBackward0' returned nan ...
I have implemented a neural network (TAPAS by Google AI) which uses some scatter operations. Previously, I was using the torch_scatter library ...
Read more >
A contribution to unobtrusive video-based measurement of ...
characterise the movements of a subject, and by changing the measuring point from ... formations and operations that are needed to compute the...
Read more >
How to do scatter and gather operations in numpy?
My understanding is in PyTorch and Tensorflow, duplicate indices result in overwriting the values. In case of TF they specifically warn that the ......
Read more >
Computer Science authors/titles "new"
We present a neural network warm-start approach for solving the inverse scattering problem, where an initial guess for the optimization problem is obtained ......
Read more >
UCLA Electronic Theses and Dissertations
We rst present TAPA (TAsk-PArallel) as a lan- guage extension to HLS, showing that convenient programming interfaces, universal software.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found