Skip to content

Commit a15733b

Browse files
committed
lint
1 parent dd14cdd commit a15733b

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

backends/aoti/aoti_backend.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import typing
1010
from abc import ABC, abstractmethod
1111
from enum import Enum
12-
from typing import Any, Dict, List, Set
12+
from typing import Any, Dict, List, Optional, Set
1313

1414
import torch
1515
from executorch.backends.aoti.passes.replace_view_copy_with_view import (
@@ -88,7 +88,9 @@ def save_data_externally(cls) -> bool:
8888
return False
8989

9090
@classmethod
91-
def get_extra_aoti_compile_context_manager(cls, compile_specs: List[CompileSpec]):
91+
def get_extra_aoti_compile_context_manager(
92+
cls, compile_specs: Optional[List[CompileSpec]] = None
93+
):
9294
"""Return extra context manager to apply during aoti_compile stage. By default returns an empty context manager.
9395
9496
Subclasses may inspect ``compile_specs`` to opt into behaviors that

backends/cuda/cuda_backend.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ def get_aoti_compile_options(
332332
return options
333333

334334
@classmethod
335-
def get_extra_aoti_compile_context_manager(cls, compile_specs: List[CompileSpec]):
335+
def get_extra_aoti_compile_context_manager(
336+
cls, compile_specs: Optional[List[CompileSpec]] = None
337+
):
336338
"""
337339
Combine all extra context managers needed during AOTInductor
338340
compilation for the CUDA backend. Each manager is documented at
@@ -344,9 +346,10 @@ def get_extra_aoti_compile_context_manager(cls, compile_specs: List[CompileSpec]
344346
through the unmodified AOTI codepath, which avoids regressions in
345347
their cuda CI exports.
346348
"""
347-
# Parse compile_specs for low_memory_mode (default OFF)
349+
# Parse compile_specs for low_memory_mode (default OFF). compile_specs
350+
# may be None when called without specs (parity with base default).
348351
low_memory_mode = "OFF"
349-
for spec in compile_specs:
352+
for spec in compile_specs or []:
350353
if spec.key == "low_memory_mode":
351354
mode = spec.value.decode("utf-8").upper()
352355
if mode not in ["ON", "OFF"]:

0 commit comments

Comments
 (0)