Skip to content

num_items_in_batch larger than the actual useful token when computing loss #38448

@SHIFTTTTTTTT

Description

@SHIFTTTTTTTT

def fixed_cross_entropy(source, target, num_items_in_batch: int = None, ignore_index: int = -100, **kwargs):
I check the shape of the inputs and find follows:
In [1]: logits.shape
Out[1]: torch.Size([4, 896, 152064])

In [2]: labels.shape
Out[2]: torch.Size([4, 896])

In [3]: num_items_in_batch
Out[3]: 4390

Why is 4390>4*896?

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