Skip to content

refactor(torch): Introduce resource-backed tensors#186

Draft
ilagomatis wants to merge 1 commit intomainfrom
feat_torch_tensor
Draft

refactor(torch): Introduce resource-backed tensors#186
ilagomatis wants to merge 1 commit intomainfrom
feat_torch_tensor

Conversation

@ilagomatis
Copy link
Copy Markdown
Collaborator

Refactor the Torch tensor structure, so that it can also hold tensor data on a vAccel resource. This way, on RPC plugin cases, the tensor content can be easily moved to the agent side and stay there, until we decide to sync the content (for output tensors).

@ilagomatis ilagomatis force-pushed the feat_torch_tensor branch 5 times, most recently from 003d665 to cc5a8cc Compare July 22, 2025 06:59
@ilagomatis ilagomatis requested a review from papazof July 22, 2025 15:07
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot dismissed their stale review July 24, 2025 07:52

outdated suggestion

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot dismissed their stale review July 24, 2025 09:57

outdated suggestion

@papazof papazof force-pushed the feat_torch_tensor branch from f1fa35b to d2be0fb Compare August 2, 2025 21:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 2, 2025

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-tidy (v18.1.8) reports: 10 concern(s)
  • src/ops/torch.c:128:29: warning: [misc-include-cleaner]

    no header providing "VACCEL_BLOB_BUFFER" is directly included

       11 |         if (res->blobs[0]->type != VACCEL_BLOB_BUFFER) {
          |                                    ^
  • src/resource.c:380:7: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'struct vaccel_blob **' to 'void *', please use explicit cast

      380 |         free(res->blobs);
          |              ^
  • src/resource.c:485:7: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'struct vaccel_blob **' to 'void *', please use explicit cast

      485 |         free(res->blobs);
          |              ^
  • src/resource.c:646:7: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'char **' to 'void *', please use explicit cast

      646 |         free(res->paths);
          |              ^
  • src/resource.c:711:7: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'struct vaccel_blob **' to 'void *', please use explicit cast

      711 |         free(res->blobs);
          |              ^
  • src/resource.c:811:7: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'struct vaccel_blob **' to 'void *', please use explicit cast

      811 |         free(res->blobs);
          |              ^
  • src/resource.c:843:8: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'struct vaccel_blob **' to 'void *', please use explicit cast

      843 |                 free(res->blobs);
          |                      ^
  • src/resource.c:860:8: warning: [bugprone-multi-level-implicit-pointer-conversion]

    multilevel pointer conversion from 'char **' to 'void *', please use explicit cast

      860 |                 free(res->paths);
          |                      ^
  • src/resource.c:998:10: warning: [misc-include-cleaner]

    no header providing "int64_t" is directly included

        3 |                         const int64_t prid_id =
          |                               ^
  • test/ops/test_torch.cpp:25:16: warning: [misc-include-cleaner]

    no header providing "strdup" is directly included

       15 | 
       16 | TEST_CASE("torch_buffer_init", "[ops][torch]")
       17 | {
       18 |         int ret;
       19 |         char data_str[] = "test";
       20 |         size_t const size = strlen(data_str) + 1;
       21 |         struct vaccel_torch_buffer buffer;
       22 | 
       23 |         SECTION("success")
       24 |         {
       25 |                 char *data = strdup(data_str);
          |                              ^

Have any feedback or feature suggestions? Share it here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 2, 2025

Coverage report diff

Filename Stmts Miss Cover
src/ops/torch.c +38 +5 +2.10%
src/resource.c +7 +8 -0.79%
TOTAL +45 +13 +0.10%

@papazof papazof marked this pull request as draft August 3, 2025 18:35
@papazof papazof removed the ok-to-test label Nov 6, 2025
Signed-off-by: Ilias Lagomatis <ilago@nubificus.co.uk>
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