Skip to content

Conversation

@svkeerthy
Copy link
Contributor

This change would enable using ir2vec::Embedding which are float vectors in ML Inliner.

@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label May 22, 2025
@llvmbot
Copy link
Member

llvmbot commented May 22, 2025

@llvm/pr-subscribers-llvm-analysis

Author: S. VenkataKeerthy (svkeerthy)

Changes

This change would enable using ir2vec::Embedding which are float vectors in ML Inliner.


Full diff: https://github.com/llvm/llvm-project/pull/141161.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp (+2-2)
diff --git a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
index 2feedd2ff40af..e7e8f2ac1ff25 100644
--- a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
@@ -261,8 +261,8 @@ static const std::vector<TensorSpec> TrainingOnlyFeatures{
 static const std::vector<TensorSpec> getInputFeatures() {
   std::vector<TensorSpec> InputSpecs;
   for (size_t I = 0; I < NumberOfFeatures; ++I)
-    InputSpecs.push_back(TensorSpec::createSpec<int64_t>(
-        TFFeedPrefix + FeatureMap[I].name(), FeatureMap[I].shape()));
+    InputSpecs.push_back(
+        TensorSpec(TFFeedPrefix + FeatureMap[I].name(), FeatureMap[I]));
   append_range(InputSpecs, TrainingOnlyFeatures);
   return InputSpecs;
 }

@mtrofin mtrofin self-requested a review May 22, 2025 23:50
Copy link
Member

@mtrofin mtrofin left a comment

Choose a reason for hiding this comment

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

lgtm, can you change the subject to say this is in the inline advisor, otherwise it reads like all TensorSpecs do that.

@svkeerthy svkeerthy changed the title Changing creation of TensorSpec in a type agnostic manner. [MLInlineAdvisor] Changing creation of TensorSpec in a type agnostic manner. May 22, 2025
@mtrofin
Copy link
Member

mtrofin commented May 23, 2025

Failures seem unrelated, merging.

@mtrofin mtrofin merged commit 73b8330 into llvm:main May 23, 2025
11 of 13 checks passed
@svkeerthy svkeerthy deleted the dev-fixes branch May 23, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants