Consumption of 'autocast' option not properly performed due to 'get' operation on line 195 not being 'pop'
Closed this issue · 2 comments
linshokaku commented
https://github.com/pfnet/pytorch-pfn-extras/blob/master/pytorch_pfn_extras/handler/_logic.py#L195
Since the 'get' operation on this line (line 195) is not 'pop', the consumption of the 'autocast' option is not being performed properly.
emcastillo commented
is this causing errors?
linshokaku commented
small example
from pytorch_pfn_extras.engine import create_trainer
import pytorch_pfn_extras as ppe
import torch.nn as nn
import torch.optim as o
class Model(nn.Module):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.l0 = nn.Linear(64, 64)
def forward(self, x):
return self.l0(x)
model = Model()
optimizer = o.SGD(model.parameters(), lr=0.1, momentum=0.9)
trainer = create_trainer(
models=model,
optimizers=optimizer,
max_epochs=2,
options={
"autocast": True,
}
)
result
ValueError: ('Unknown options: ', {'autocast': True})
An error occurs at the following point because the option is not being consumed properly.
pytorch-pfn-extras/pytorch_pfn_extras/engine.py
Lines 110 to 111 in 1b11caf