Skip to content

Check if cross entropy is applied correctly in all monkey patch functions #920

@Tcc0403

Description

@Tcc0403

🐛 Describe the bug

Some of them aren't patched to the correct object.
For example: InternVL doesn't have nn.CrossEntropy in its modeling file. The monkey patch should be applied to the loss_util file (See comment)

if cross_entropy:
logger.warning(TRANSFORMER_DEPRECATION_WARNING)
modeling_internvl.nn.CrossEntropyLoss = LigerCrossEntropyLoss

Note that some monkey patch functions are outdated, so you may need to check them manually

p.s. we only need to support transformers>=4.49.0. bwd-test ci is targeting to 4.49.0.

Reproduce

No response

Versions

liger_kernel==da6e705

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions