Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

[bugfix] Fix the incorrect with-statement

Open aaa123git opened this issue 6 months ago • 1 comments

You may want to enter multiple context managers in one with-statement. However, with rng_context and fp8_context is equivalent to with fp8_context, because rng_context doesn't rewrite __and__ method. The correct way is with rng_context, fp8_context: .

Ref: https://docs.python.org/3/reference/compound_stmts.html#the-with-statement

aaa123git avatar Aug 07 '24 11:08 aaa123git