Skip to content

Added Encoder Models for Model ops - #468

Draft
Kanupriyagoyal wants to merge 3 commits into
torch-spyre:mainfrom
Kanupriyagoyal:model_ops_encoder_model
Draft

Added Encoder Models for Model ops #468
Kanupriyagoyal wants to merge 3 commits into
torch-spyre:mainfrom
Kanupriyagoyal:model_ops_encoder_model

Conversation

@Kanupriyagoyal

Copy link
Copy Markdown

Added Encoder Models
bert_base_uncased/run_huggingface.py
bert_large_uncased/run_huggingface.py
granite_embedding_278m_multilingual/run_huggingface.py
roberta_base_squad2/run_huggingface.py
utils/model_ops/utils/torchop_yaml_cpu.py

Signed-off-by: Kanupriyagoyal <kanupriya.goyal@ibm.com>
logging.getLogger("TorchOpCollector").warning(
"CUDA is not available. Running on CPU."
)
return

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please use the original code to force the use of CUDA. This is intended to capture accelerator-aware behavior.

@Kanupriyagoyal Kanupriyagoyal Sep 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We haven't access for CUDA, so the scripts have been generated using the cpu.
cc: @saurabh-srivastava4 @marutdas @ani300 ajitsjohn@gmail.com



# Ops whose tensor inputs should use Xavier init when dtype/rank also qualify.
_XAVIER_OPS = {"torch.matmul", "torch.nn.functional.linear"}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please sync with the latest one

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

adressed

@kiszk kiszk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The differences between torchop_yaml.py and torchop_yaml_cpu.py are very small. Could you drop torchop_yaml_cpu.py and submit a diff against torchop_yaml.py?
It will drastically reduce the burden of future maintenance.

@Kanupriyagoyal
Kanupriyagoyal force-pushed the model_ops_encoder_model branch from 3098ac0 to 1378908 Compare September 8, 2026 06:51
@Kanupriyagoyal
Kanupriyagoyal marked this pull request as draft September 10, 2026 11:28
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