Skip to content

Layout Transform#174

Merged
koparasy merged 3 commits intodevelopfrom
features/layout-transform
Dec 6, 2025
Merged

Layout Transform#174
koparasy merged 3 commits intodevelopfrom
features/layout-transform

Conversation

@koparasy
Copy link
Member

@koparasy koparasy commented Dec 5, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new abstract base class LayoutTransform that defines the interface for transforming application-level tensor data (Inputs, Inouts, Outputs) into contiguous model inputs and vice versa. This abstraction allows the AMS pipeline to remain agnostic about data layout while delegating all shape and packing logic to concrete implementations.

  • Adds LayoutTransform abstract base class with pack(), unpack(), and name() methods
  • Provides comprehensive unit tests with a dummy implementation to verify the interface
  • Integrates the new test into the CMake build system

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/AMSlib/wf/layout_transform.hpp Defines the abstract LayoutTransform interface for data transformation between application and model formats
tests/AMSlib/wf/layout_transform.cpp Implements test cases covering the three interface methods using a dummy transform implementation
tests/AMSlib/wf/CMakeLists.txt Adds build configuration for the new layout_transform test executable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +43
void unpack(const torch::jit::IValue& iv,
ams::TensorBundle& Outputs,
ams::TensorBundle& Inouts,
std::optional<at::Tensor>& Uncertainties) override
{
// Expect a tuple of 2 tensors
auto tup = iv.toTuple();
auto pred = tup->elements()[0].toTensor();
auto uncrt = tup->elements()[1].toTensor();

// Output bundle receives the prediction
Outputs.add("pred", pred);

Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The unpack() method signature includes an Inouts parameter that can be modified by implementations. However, the test coverage only verifies Outputs and Uncertainties. Consider adding a test case that verifies Inouts can be properly modified by unpack(), similar to how other test files in this directory comprehensively test all functionality.

Copilot uses AI. Check for mistakes.
koparasy and others added 2 commits December 5, 2025 16:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@koparasy koparasy merged commit a2d2916 into develop Dec 6, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants