Skip to content

[QST] On adding an optimizer for sparse feature embeddings #322

Closed

Description

@gameofdimension

What is your question?

From

https://github.com/NVIDIA/recsys-examples/blob/main/examples/commons/distributed/sharding.py#L236-L272

we see that both apply_optimizer_in_backward and fused_params are used to add optimizer for embeddings.

However, TorchRec documentation suggests these are equivalent approaches. Is there a specific reason for using both simultaneously?


By submitting this issue, you agree to follow our code of conduct and our contributing guidelines.

Activity

  1. added
    question
    on Mar 11, 2026
  2. gameofdimension commented on Mar 13, 2026

    @gameofdimension
    ContributorAuthor

    @shijieliu Could you help clarify this issue?

  3. shijieliu commented on Mar 13, 2026

    @shijieliu
    Collaborator

    hi @gameofdimension thanks for your question.

    For dynamicemb, it bypasses the param interface in torch and directly use fused_params to create optimizer. I think maybe we can remove apply_optimizer_in_backward and only use fused_params. @JacoCheung any comments?

  4. JacoCheung commented on Mar 19, 2026

    @JacoCheung
    Collaborator

    @gameofdimension Yes, you're right. Both should work.
    The fused_params has more than optimizer params. It will absorb the params that apply_optimizer_in_backward has provided here. (apply_optimizer_in_backward has higher priority than fused_params )

    The apply_optimizer_in_backward is redundant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions