aai-institute / aai-institute/pyDVL

Flatten for eigen methods

オープン
#401 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
benchmarking enhancement
主要言語
Python
スター
146
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

When using eigsh routines from scipy or cupy, we have to output a flat tensor from the matvec function. However, when calling the hvp on the functional call to the model, the output is a dict of tensors. Right now, we have to flatten after each hvp call, e.g. for one batch:

```python
def batch_hvp(vec: torch.Tensor):
return flatten_tensors_to_vector(
hvp(
batch_loss,
model_params,
align_structure(model_params, vec),
reverse_only=reverse_only,
).values()
)
```

We should investigate the runtime and memory consequences of this and if there is an alternative for it.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。