Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensor shape and dimension names as separate arrow fields #8376

Merged
merged 37 commits into from
Dec 18, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Dec 9, 2024

Related

What

⚠️ Breaks tensors in .rrd files!

In TensorData we used to have shape: [TensorDimension] with struct TensorDimension { size: u64, name: Option<String> }.

Now TensorData has shape: [u64], names: Option<[String]> instead.

So basically a AoS -> SoA change

TODO

  • Port Python
  • Port C++
  • Document in migration guide
  • Run @rerun-bot full-check

@emilk emilk added codegen/idl exclude from changelog PRs with this won't show up in CHANGELOG.md include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages labels Dec 9, 2024
Copy link

github-actions bot commented Dec 9, 2024

Latest documentation preview deployed successfully.

Result Commit Link
6a3b3c6 https://landing-ggoladybv-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

Copy link

github-actions bot commented Dec 9, 2024

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
6a3b3c6 https://rerun.io/viewer/pr/8376 +nightly +main

Note: This comment is updated whenever you push a commit.

@emilk emilk force-pushed the emilk/refactor-tensor branch from 7d68a74 to 416ba00 Compare December 10, 2024 09:57
crates/top/rerun/src/lib.rs Show resolved Hide resolved
docs/snippets/README.md Show resolved Hide resolved
@emilk
Copy link
Member Author

emilk commented Dec 10, 2024

@rerun-bot full-check

Copy link

@emilk
Copy link
Member Author

emilk commented Dec 10, 2024

@rerun-bot full-check

Copy link

Started a full build: https://github.com/rerun-io/rerun/actions/runs/12258330176

@emilk emilk marked this pull request as ready for review December 11, 2024 07:22
@emilk
Copy link
Member Author

emilk commented Dec 11, 2024

@rerun-bot full-check

Copy link

Started a full build: https://github.com/rerun-io/rerun/actions/runs/12271591874

@teh-cmc teh-cmc self-requested a review December 11, 2024 08:42
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

My only gripe is that there doesn't seem to exist any centralized place that communicates clearly what happens when the number of names doesn't match the number of dimensions.
Actually, I'm not even sure the behavior itself is consistent all over the place, since it also feels pretty decentralized (which might very well be unavoidable).
But maybe I'm wrong and I'm missing the logic, it's a large diff and I suck at reviews.

crates/store/re_types/src/archetypes/tensor_ext.rs Outdated Show resolved Hide resolved
crates/store/re_types/src/datatypes/tensor_data_ext.rs Outdated Show resolved Hide resolved
crates/store/re_types/src/datatypes/tensor_data_ext.rs Outdated Show resolved Hide resolved
crates/top/rerun/src/lib.rs Show resolved Hide resolved
Comment on lines +23 to +33
pub fn from_tensor_data(tensor_data: &re_types::datatypes::TensorData) -> Vec<Self> {
tensor_data
.shape
.iter()
.enumerate()
.map(|(dim_idx, dim_len)| Self {
size: *dim_len,
name: tensor_data.dim_name(dim_idx).cloned(),
})
.collect()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this one clamps from the dimensions's pov 🤔

docs/snippets/README.md Show resolved Hide resolved
@emilk
Copy link
Member Author

emilk commented Dec 17, 2024

DNM: Let's wait for the 0.21 release before we merge this

@emilk emilk added the do-not-merge Do not merge this PR label Dec 17, 2024
@emilk emilk removed the do-not-merge Do not merge this PR label Dec 18, 2024
@emilk emilk merged commit 879e531 into main Dec 18, 2024
39 of 40 checks passed
@emilk emilk deleted the emilk/refactor-tensor branch December 18, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl exclude from changelog PRs with this won't show up in CHANGELOG.md include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split TensorDimension into shape and names
4 participants