Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/a2a3/runtime/host_build_graph/aicpu/aicpu_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,27 @@
* See LICENSE in the root of the software repository for the full text of the License.
* -----------------------------------------------------------------------------------------------------------
*/
#include <unistd.h>

#include <atomic>
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#ifdef __linux__
#include <sys/mman.h>
#endif

#include "aicpu/device_time.h"
#include "aicpu/device_phase_aicpu.h"
#include "callable_protocol.h"
#include "dispatch_payload.h"
#include "runtime.h"
#include "spin_hint.h"

// Runtime headers (full struct definition for create/destroy + SIMPLER_SCOPE)
#include "host_build_graph/runtime_core.h"
#include "host_build_graph/runtime_types.h"
#include "host_build_graph/shared_memory.h"

// Performance profiling headers
#include "aicpu/chip_swimlane_collector_aicpu.h"
#include "aicpu/args_dump_aicpu.h"
#include "common/chip_swimlane_profiling.h"
#include "common/unified_log.h"

// Register-based communication
#include "aicpu/platform_aicpu_affinity.h"
#include "aicpu/platform_regs.h"
#include "common/platform_config.h"
#include "utils/thread_completion_gate.h"

// Core type definitions
#include "common/core_type.h"

// CoreCallable for resolved dispatch address
#include "callable.h"

// Scheduler data structures (CoreExecState, CoreTracker, etc.)
#include "scheduler/scheduler_types.h"

Expand Down
5 changes: 2 additions & 3 deletions src/a2a3/runtime/host_build_graph/host/runtime_maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
#include <memory>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
#include <unordered_map>
#include <vector>

#include "assert_compat.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/common.h"
#include "host_build_graph/dep_gen_host_graph.h"
#include "host_build_graph/graph_execution.h"
#include "host_build_graph/host_tensor_access.h"
Expand All @@ -72,7 +71,7 @@
#include "../../../../common/worker/runtime_c_api.h"
#include "callable.h"
#include "common/host_log_binding.h"
#include "common/log_clock.h"
#include "common/host_phase_kind.h"
#include "common/platform_config.h"
#include "common/unified_log.h"
#include "host_log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/a2a3/runtime/host_build_graph/orchestration/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
* See LICENSE in the root of the software repository for the full text of the License.
* -----------------------------------------------------------------------------------------------------------
*/
#include "assert_compat.h"
#include "host_build_graph/common.h"

#ifdef __linux__
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <unistd.h>

#include <array>
#include <cstring>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,22 @@
#include <stddef.h>
#include <stdint.h>

#include <array>
#include <algorithm>
#include <condition_variable>
#include <cstring>
#include <ctime>
#include <functional>
#include <mutex>
#include <thread>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

// Type headers needed by orchestration
#include "host_build_graph/common.h" // framework_bind_runtime / framework_current_runtime
#include "common/host_phase_kind.h" // HostPhaseKind, for the phase records below
#include "host_build_graph/graph_cache.h" // Graph Execution key and result helpers
#include "host_build_graph/graph_host_state.h" // GRAPH_MAX_DEFINITIONS
#include "host_build_graph/runtime_ops.h" // RuntimeOps, RuntimeContext forward declaration
#include "host_build_graph/runtime_types.h" // SIMPLER_ERROR_*
#include "host_build_graph/submit_types.h" // MixedKernels, INVALID_KERNEL_ID, subtask slots
#include "types.h" // Arg, TaskOutputTensors, TensorArgType
#include "task_args.h" // ChipStorageTaskArgs, simpler::hbg::Tensor
#include "tensor.h" // simpler::hbg::Tensor, TensorCreateInfo
#include "assert_compat.h" // debug_assert
#include "host_build_graph/common.h" // framework_bind_runtime / framework_current_runtime
#include "common/host_phase_kind.h" // HostPhaseKind, for the phase records below
#include "host_build_graph/graph_cache.h" // Graph Execution key and result helpers
#include "host_build_graph/runtime_ops.h" // RuntimeOps, RuntimeContext forward declaration
#include "host_build_graph/runtime_status.h" // SIMPLER_ERROR_*
#include "host_build_graph/submit_types.h" // MixedKernels, INVALID_KERNEL_ID, subtask slots
#include "types.h" // Arg, TaskOutputTensors, TensorArgType
#include "tensor.h" // simpler::hbg::Tensor, TensorCreateInfo

// =============================================================================
// simpler::hbg::Tensor Factory Helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <atomic>
#include <cstdint>

#include "aicore_completion_mailbox_types.h"
#include "host_build_graph/constants.h"
#include "host_build_graph/task_id.h"

Expand Down
5 changes: 2 additions & 3 deletions src/a2a3/runtime/host_build_graph/runtime/async_wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
#pragma once

#include <atomic>
#include <cstddef>
#include <cstdint>

#include "aicpu/platform_regs.h"
#include "backend/sdma/sdma_completion_scheduler.h"
#include "intrinsic.h"
#include "aicore_completion_mailbox.h"
#include "aicore_completion_mailbox_types.h"
#include "host_build_graph/completion_token.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/runtime_types.h"

struct SchedulerState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

#pragma once

#include <cstddef>
#include <cstdint>

#include "aicpu/platform_regs.h"
#include "aicore_completion_mailbox.h"
#include "aicpu/cache_maintenance.h"
#include "host_build_graph/completion_token.h"
#include "host_build_graph/constants.h"
#include "host_build_graph/runtime_status.h"

inline uintptr_t sdma_completion_cache_line(const volatile void *addr) {
Expand Down
11 changes: 8 additions & 3 deletions src/a2a3/runtime/host_build_graph/runtime/scheduler/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@

#include <atomic>

#include "common/core_type.h"
#include "common/memory_barrier.h"
#include "utils/device_arena.h"
#include "aicpu/platform_regs.h" // get_reg_ptr / RegId for the early-dispatch doorbell
#include "async_wait.h"
#include "host_build_graph/graph_execution.h"
#include "host_build_graph/task_id.h"
#include "host_build_graph/task_allocator.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/runtime_types.h"
#include "host_build_graph/shared_memory.h"
// Defines the SIMPLER_*_PROFILING levels the conditionals below test. An #if on an
// undefined macro evaluates to 0, so a profiling block reached through a transitive
// include would switch itself off silently if that path ever went away.
#include "profiling_config.h"

#include "aicpu/device_time.h" // get_sys_cnt_aicpu (used by early-dispatch doorbell timing too)
#if SIMPLER_ORCH_PROFILING || SIMPLER_SCHED_PROFILING
#include "aicpu/device_time.h" // get_sys_cnt_aicpu, used only by the timed blocks below
#endif
#if SIMPLER_SCHED_PROFILING
#define SCHED_CYCLE_START() uint64_t _st0 = get_sys_cnt_aicpu(), _st1
#define SCHED_CYCLE_LAP(acc) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <cinttypes>
#include <cstdio>

#include "assert_compat.h"
#include "common/unified_log.h"
#include "aicpu/device_time.h"
#include "aicpu/chip_swimlane_collector_aicpu.h"
Expand All @@ -22,6 +23,7 @@
#include "common/memory_barrier.h"
#include "common/chip_swimlane_profiling.h"
#include "common/platform_config.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/runtime_core.h"
#include "host_build_graph/shared_memory.h"
#include "runtime.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
*/
#include "scheduler_context.h"

#include <algorithm>

#include "common/unified_log.h"
#include "aicpu/device_time.h"
#include "aicpu/platform_regs.h"
#include "common/chip_swimlane_profiling.h"
#include "common/memory_barrier.h"
#include "common/platform_config.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/runtime_core.h"
#include "runtime.h"
#include "spin_hint.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
#pragma once

#include "assert_compat.h"
#include "aicpu/device_phase_aicpu.h"
#include "aicpu/platform_regs.h"
#include "common/chip_swimlane_profiling.h"
Expand All @@ -19,7 +20,6 @@

#include "scheduler/scheduler.h"

#include "aicore_completion_mailbox.h"
#include "dispatch_payload.h"

// runtime.h cannot be included here — it pulls in Handshake, which this header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
#include <cinttypes>
#include <limits>

#include "host_build_graph/common.h" // debug_assert
#include "assert_compat.h" // debug_assert
#include "host_build_graph/common.h"

#include "common/unified_log.h"
#include "aicpu/aicpu_device_config.h"
#include "aicpu/device_time.h"
#include "aicpu/platform_regs.h"
#include "callable.h"
#include "common/chip_swimlane_profiling.h"
#include "common/memory_barrier.h"
#include "common/platform_config.h"
#include "host_build_graph/async_poll_phase_accumulator.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/runtime_core.h"
#include "runtime.h"
#include "spin_hint.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <cstddef>
#include <cstdint>

#include "assert_compat.h"
#include "common/core_type.h"
#include "common/platform_config.h"
#include "host_build_graph/runtime_types.h"
Expand Down
8 changes: 0 additions & 8 deletions src/a5/runtime/host_build_graph/aicpu/aicpu_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,21 @@
* See LICENSE in the root of the software repository for the full text of the License.
* -----------------------------------------------------------------------------------------------------------
*/
#include <unistd.h>

#include <atomic>
#include <algorithm>
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#ifdef __linux__
#include <sys/mman.h>
#endif

#include "aicore_lifecycle.h"
#include "aicore_scheduler_error.h"
#include "aicore_scheduler_state.h"
#include "aicpu/aicpu_device_config.h"
#include "aicpu/cache_maintenance.h"
#include "aicpu/args_dump_aicpu.h"
#include "aicpu/chip_swimlane_collector_aicpu.h"
#include "aicpu/device_phase_aicpu.h"
#include "aicpu/device_time.h"
#include "aicpu/pmu_collector_aicpu.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/shared_memory.h"
#include "runtime.h"
Expand Down
5 changes: 2 additions & 3 deletions src/a5/runtime/host_build_graph/host/runtime_maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@
#include <mutex>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
#include <unordered_map>
#include <vector>

#include "assert_compat.h"
#include "host_build_graph/runtime_status.h"
#include "host_build_graph/common.h"
#include "host_build_graph/dep_gen_host_graph.h"
#include "host_build_graph/graph_execution.h"
#include "scheduler/scheduler_graph.h"
Expand All @@ -76,7 +75,7 @@
#include "../../../../common/worker/runtime_c_api.h"
#include "callable.h"
#include "common/host_log_binding.h"
#include "common/log_clock.h"
#include "common/host_phase_kind.h"
#include "common/platform_config.h"
#include "common/unified_log.h"
#include "host_log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/a5/runtime/host_build_graph/orchestration/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
* See LICENSE in the root of the software repository for the full text of the License.
* -----------------------------------------------------------------------------------------------------------
*/
#include "assert_compat.h"
#include "host_build_graph/common.h"

#ifdef __linux__
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <unistd.h>

#include <array>
#include <cstring>
Expand Down
26 changes: 9 additions & 17 deletions src/a5/runtime/host_build_graph/orchestration/orchestration_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,22 @@
#include <stddef.h>
#include <stdint.h>

#include <array>
#include <algorithm>
#include <condition_variable>
#include <cstring>
#include <ctime>
#include <functional>
#include <mutex>
#include <thread>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

// Type headers needed by orchestration
#include "host_build_graph/common.h" // framework_bind_runtime / framework_current_runtime
#include "common/host_phase_kind.h" // HostPhaseKind, for the phase records below
#include "host_build_graph/graph_cache.h" // Graph Execution key and result helpers
#include "host_build_graph/graph_host_state.h" // GRAPH_MAX_DEFINITIONS
#include "host_build_graph/runtime_ops.h" // RuntimeOps, RuntimeContext forward declaration
#include "host_build_graph/runtime_types.h" // SIMPLER_ERROR_*
#include "host_build_graph/submit_types.h" // MixedKernels, INVALID_KERNEL_ID, subtask slots
#include "types.h" // Arg, TaskOutputTensors, TensorArgType
#include "task_args.h" // ChipStorageTaskArgs, simpler::hbg::Tensor
#include "tensor.h" // simpler::hbg::Tensor, TensorCreateInfo
#include "assert_compat.h" // debug_assert
#include "host_build_graph/common.h" // framework_bind_runtime / framework_current_runtime
#include "common/host_phase_kind.h" // HostPhaseKind, for the phase records below
#include "host_build_graph/graph_cache.h" // Graph Execution key and result helpers
#include "host_build_graph/runtime_ops.h" // RuntimeOps, RuntimeContext forward declaration
#include "host_build_graph/runtime_status.h" // SIMPLER_ERROR_*
#include "host_build_graph/submit_types.h" // MixedKernels, INVALID_KERNEL_ID, subtask slots
#include "types.h" // Arg, TaskOutputTensors, TensorArgType
#include "tensor.h" // simpler::hbg::Tensor, TensorCreateInfo

// =============================================================================
// simpler::hbg::Tensor Factory Helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <atomic>
#include <cstdint>

#include "aicore_completion_mailbox_types.h"
#include "host_build_graph/constants.h"
#include "host_build_graph/task_id.h"

Expand Down
Loading
Loading