Skip to content

Commit 79d5fda

Browse files
authored
NvTensorRtRtx: Skip if node of Phi4 models (microsoft#1696)
Skip if node of Phi4 models
1 parent a2bbbc6 commit 79d5fda

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/python/py/models/builder.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,14 +1459,15 @@ def make_rotary_embedding_multi_cache(self, **kwargs):
14591459
self.rope_attrs["save_caches"] = False
14601460
cos_cache_small, sin_cache_small = self.make_rotary_embedding_caches(cos_cache_name=cos_cache_small_name, sin_cache_name=sin_cache_small_name)
14611461

1462-
if self.ep == "dml":
1463-
# Concat small and large cos/sin caches for DML EP only
1462+
if self.ep in ["dml", "NvTensorRtRtx"]:
1463+
# Concat small and large cos/sin caches for DML and NvTensorRtRtx EPs
1464+
# These EPs don't support the If operator
14641465
cos_cache = torch.cat((cos_cache_small, cos_cache_large), dim=0)
14651466
sin_cache = torch.cat((sin_cache_small, sin_cache_large), dim=0)
14661467
# Save cos/sin caches to disk
14671468
self.make_initializer(cos_cache, cos_cache_name)
14681469
self.make_initializer(sin_cache, sin_cache_name)
1469-
# Do NOT make the subgraph with the If node for DML EP.
1470+
# Do NOT make the subgraph with the If node for these EPs.
14701471
return
14711472

14721473
# Make the following subgraph to decide which cos/sin caches to use in the rotary embeddings

0 commit comments

Comments
 (0)