Skip to content

Conversation

@slokesha
Copy link

@slokesha slokesha commented Oct 28, 2025

Added Workaround for Assertion error when embedding with bge-m3 in lazy mode.

For RoBERTa models, the position_ids are recalculated using the function create_position_ids_from_input_ids_hpu().
However, due to a known issue on HPU where modifying an already allocated tensor in-place can lead to invalid or corrupted values, this workaround precomputes position_ids on the CPU using the corresponding input_ids.
The computed position_ids are then transferred to the HPU within hpu_model_runner to ensure correctness and avoid in-place modification issues.

Signed-off-by: slokesha <[email protected]>
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