Skip to content

Conversation

@NicholasCao
Copy link

@NicholasCao NicholasCao commented Sep 12, 2022

In the following two scenarios,

for step, inputs in enumerate(cycle(train_dataloader)):
    inputs = inputs.to(device)
    ...

or

dataloader = cycle(iter(train_dataloader))
for step in range(max_steps):
    input = next(dataloader)
    inputs = inputs.to(device)
    ...

raw InputFeatures.to(...) causes infinite growth of GPU memory and unavailability of used inputs (e.g. SoftTemplate modifies input_ids of inputs by batch['input_ids'] = None)

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