Skip to content

New features, bug fixes and housekeeping

Compare
Choose a tag to compare
@vfdev-5 vfdev-5 released this 05 Sep 11:15

PyTorch-Ignite 0.4.10 - Release Notes

New Features

Engine

  • Added Engine interrupt/continue feature (#2699, #2682)

Example:

from ignite.engine import Engine, Events

data = range(10)
max_epochs = 3

def check_input_data(e, b):
    print(f"Epoch {engine.state.epoch}, Iter {engine.state.iteration} | data={b}")
    i = (e.state.iteration - 1) % len(data)
    assert b == data[i]

engine = Engine(check_input_data)

@engine.on(Events.ITERATION_COMPLETED(every=11))
def call_interrupt():
    engine.interrupt()

print("Start engine run with interruptions:")
state = engine.run(data, max_epochs=max_epochs)
print("1 Engine run is interrupted at ", state.epoch, state.iteration)
state = engine.run(data, max_epochs=max_epochs)
print("2 Engine run is interrupted at ", state.epoch, state.iteration)
state = engine.run(data, max_epochs=max_epochs)
print("3 Engine ended the run at ", state.epoch, state.iteration)
Output
Start engine run with interruptions:
Epoch 1, Iter 1 | data=0
Epoch 1, Iter 2 | data=1
Epoch 1, Iter 3 | data=2
Epoch 1, Iter 4 | data=3
Epoch 1, Iter 5 | data=4
Epoch 1, Iter 6 | data=5
Epoch 1, Iter 7 | data=6
Epoch 1, Iter 8 | data=7
Epoch 1, Iter 9 | data=8
Epoch 1, Iter 10 | data=9
Epoch 2, Iter 11 | data=0
1 Engine run is interrupted at  2 11
Epoch 2, Iter 12 | data=1
Epoch 2, Iter 13 | data=2
Epoch 2, Iter 14 | data=3
Epoch 2, Iter 15 | data=4
Epoch 2, Iter 16 | data=5
Epoch 2, Iter 17 | data=6
Epoch 2, Iter 18 | data=7
Epoch 2, Iter 19 | data=8
Epoch 2, Iter 20 | data=9
Epoch 3, Iter 21 | data=0
Epoch 3, Iter 22 | data=1
2 Engine run is interrupted at  3 22
Epoch 3, Iter 23 | data=2
Epoch 3, Iter 24 | data=3
Epoch 3, Iter 25 | data=4
Epoch 3, Iter 26 | data=5
Epoch 3, Iter 27 | data=6
Epoch 3, Iter 28 | data=7
Epoch 3, Iter 29 | data=8
Epoch 3, Iter 30 | data=9
3 Engine ended the run at  3 30
  • Deprecated and replaced Events.default_event_filter with None (#2644)
  • [BC-breaking] Rewritten Engine's terminate and terminate_epoch logic (#2645)
  • Improved logging time taken message showing milliseconds (#2650)

Metrics and handlers

  • Added ZeRO built-in support to Checkpoint in a distributed configuration (#2658, #2642)
  • Added save_on_rank argument to DiskSaver and Checkpoint (#2641)
  • Added a handle_buffers option for EMAHandler (#2592)
  • Improved Precision and Recall metrics (#2573)

Bug fixes

  • Median metrics (e.g median absolute error) are now using np.median-compatible torch median implementation (#2681)
  • Fixed issues when removing handlers on filtered events (#2690)
  • Few minor fixes in Engine and Event (#2680)
  • [BC-breaking] Fixed Engine.terminate() behaviour when resumed (#2678)

Housekeeping (docs, CI, examples, tests, etc)

Acknowledgments

🎉 Thanks to our community and all our contributors for the issues, PRs and 🌟 ⭐️ 🌟 !
💯 We really appreciate your implication into the project (in alphabetical order):

@BowmanChow, @daniellepintz, @haochunchang, @kamalojasv181, @puhuk, @sadra-barikbin, @sandylaker, @sdesrozis, @vfdev-5