Revert "[inductor] Refactor runtime files into torch._inductor.runtime (part 4) (#124559)"

This reverts commit 9ea2a0951005c4bcb2491556a8548319c6cccfdb.

Reverted https://github.com/pytorch/pytorch/pull/124559 on behalf of https://github.com/jeanschmidt due to There are internal breakages, already discussed with author and he'll FF ([comment](https://github.com/pytorch/pytorch/pull/124552#issuecomment-2070548223))
diff --git a/test/inductor/test_coordinate_descent_tuner.py b/test/inductor/test_coordinate_descent_tuner.py
index 8f57cab..5b9f35f 100644
--- a/test/inductor/test_coordinate_descent_tuner.py
+++ b/test/inductor/test_coordinate_descent_tuner.py
@@ -18,7 +18,7 @@
     raise unittest.SkipTest("requires triton")  # noqa: TRY200
 
 from torch._inductor import config
-from torch._inductor.runtime.coordinate_descent_tuner import CoordescTuner
+from torch._inductor.coordinate_descent_tuner import CoordescTuner
 
 config.benchmark_kernel = True
 config.coordinate_descent_tuning = True
diff --git a/torch/_inductor/runtime/coordinate_descent_tuner.py b/torch/_inductor/coordinate_descent_tuner.py
similarity index 97%
rename from torch/_inductor/runtime/coordinate_descent_tuner.py
rename to torch/_inductor/coordinate_descent_tuner.py
index 83f4973..2511800 100644
--- a/torch/_inductor/runtime/coordinate_descent_tuner.py
+++ b/torch/_inductor/coordinate_descent_tuner.py
@@ -3,14 +3,15 @@
 import logging
 from typing import Callable, Optional
 
-from torch._inductor.runtime.runtime_utils import red_text, triton_config_to_hashable
+from torch.utils._triton import has_triton
+from .runtime.runtime_utils import red_text, triton_config_to_hashable
 
-try:
+if has_triton():
     import triton
-except ImportError:
+else:
     triton = None
 
-from torch._inductor import config as inductor_config
+from . import config as inductor_config
 
 log = logging.getLogger(__name__)
 
diff --git a/torch/_inductor/runtime/triton_heuristics.py b/torch/_inductor/runtime/triton_heuristics.py
index 1b04675..89be8f3 100644
--- a/torch/_inductor/runtime/triton_heuristics.py
+++ b/torch/_inductor/runtime/triton_heuristics.py
@@ -21,7 +21,7 @@
 from torch._dynamo.utils import dynamo_timed, get_first_attr
 
 from torch._inductor import config
-from .coordinate_descent_tuner import CoordescTuner
+from torch._inductor.coordinate_descent_tuner import CoordescTuner
 from .hints import (
     _NUM_THREADS_PER_WARP,
     AutotuneHint,
@@ -29,6 +29,7 @@
     ReductionHint,
     TileHint,
 )
+
 from .runtime_utils import (
     cache_dir,
     ceildiv,