Skip to content

[AINode] Fix inference output TsBlock type#17766

Merged
CRZbulabula merged 1 commit into
masterfrom
fix-ainode-inference-double-output
May 25, 2026
Merged

[AINode] Fix inference output TsBlock type#17766
CRZbulabula merged 1 commit into
masterfrom
fix-ainode-inference-double-output

Conversation

@CRZbulabula
Copy link
Copy Markdown
Contributor

Description

Fix inference output type

DataNode declares CALL INFERENCE output schema as DOUBLE, but AINode serialized model tensors using their original dtype. For float32 outputs such as chronos2, this produced a FLOAT TsBlock column and clients calling getDouble() failed.

This PR converts inference outputs to torch.float64 before TsBlock serialization so the physical TsBlock column matches the DOUBLE result schema.

Tests

  • Added coverage in AINodeSharedClusterIT to assert the output metadata type is DOUBLE and actually read values with ResultSet#getDouble("output").
  • Verified AINode serde converts the manager output path to DOUBLE.
  • Ran black .
  • Ran isort --profile black .
  • Ran mvn spotless:apply -pl integration-test -P with-integration-tests
  • Ran mvn -pl integration-test -P with-integration-tests test-compile

This PR has:

  • been self-reviewed.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added integration tests.

Key changed/added classes (or packages if there are too many classes) in this PR
  • iotdb-core/ainode/iotdb/ainode/core/manager/inference_manager.py
  • integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeSharedClusterIT.java

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.59%. Comparing base (75d6855) to head (861e50c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17766      +/-   ##
============================================
- Coverage     40.60%   40.59%   -0.01%     
  Complexity     2574     2574              
============================================
  Files          5179     5179              
  Lines        350271   350271              
  Branches      44790    44790              
============================================
- Hits         142228   142208      -20     
- Misses       208043   208063      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CRZbulabula CRZbulabula merged commit 7af3438 into master May 25, 2026
43 of 45 checks passed
@CRZbulabula CRZbulabula deleted the fix-ainode-inference-double-output branch May 25, 2026 15:30
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.

1 participant