Skip to content

Simplify AicpuExecutor API and unify naming conventions - #7

Closed
ChaoZheng109 wants to merge 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:runtime-args2
Closed

ChaoZheng109 wants to merge 1 commit into
hw-native-sys:mainfrom
ChaoZheng109:runtime-args2

Conversation

@ChaoZheng109

Copy link
Copy Markdown
Collaborator

Summary

This PR simplifies the AICPU executor interface and improves code consistency through refactoring and renaming.

Changes

  • Rename: runtimeexecutor.cpp → aicpu_executor.cpp, RuntimeExecutor → AicpuExecutor
  • Remove redundant parameter: Removed runtimeCtx from KernelArgs structure
  • Simplify API: Reduced redundant input parameters in executor methods
  • Unify naming: Changed global variable g_executor → g_aicpu_executor for better clarity

Files Changed

  • src/runtime/aicpu/runtimeexecutor.cpp → src/runtime/aicpu/aicpu_executor.cpp
  • src/platform/a2a3/aicpu/kernel.cpp
  • src/platform/a2a3/common/kernel_args.h
  • src/platform/a2a3/host/devicerunner.cpp
  • example/main.py

Impact

  • Cleaner and more consistent naming convention
  • Simplified function signatures with fewer parameters
  • No functional behavior changes

## Summary
This PR simplifies the AICPU executor interface and improves code consistency through refactoring and renaming.

## Changes
- **Rename**: `runtimeexecutor.cpp` → `aicpu_executor.cpp`, `RuntimeExecutor` → `AicpuExecutor`
- **Remove redundant parameter**: Removed `runtimeCtx` from `KernelArgs` structure
- **Simplify API**: Reduced redundant input parameters in executor methods
- **Unify naming**: Changed global variable `g_executor` → `g_aicpu_executor` for better clarity

## Files Changed
- `src/runtime/aicpu/runtimeexecutor.cpp` → `src/runtime/aicpu/aicpu_executor.cpp`
- `src/platform/a2a3/aicpu/kernel.cpp`
- `src/platform/a2a3/common/kernel_args.h`
- `src/platform/a2a3/host/devicerunner.cpp`
- `example/main.py`

## Impact
- Cleaner and more consistent naming convention
- Simplified function signatures with fewer parameters
- No functional behavior changes
ChaoWao added a commit to ChaoWao/simpler-fork that referenced this pull request Jun 26, 2026
…tgun

- running-onboard: redirect device logs via ASCEND_PROCESS_LOG_PATH (export == --env);
  add a 507018 triage table (deadlock-detect vs SPIN-timeout vs OS op-timeout vs
  forward-progress stall) so a generic host 507018 is classified from the device log.
- new dfx-analyze skill: reach for simpler's built-in DFX tools (device_log_timing,
  swimlane_converter, sched_overhead_analysis, deps_viewer, dump_viewer) instead of
  hand-rolling timing/instrumentation in the runtime.
- codestyle rule hw-native-sys#7: never log on AICPU hot paths (floods device_log -> op-timeout,
  masking the behavior under study).
- multi-repo-setup: non-editable reinstall can silently skip the runtime .so rebuild;
  verify the built .so changed or cmake --build the cache + sync to both load locations.
ChaoWao added a commit that referenced this pull request Jun 26, 2026
…tgun (#1163)

- running-onboard: redirect device logs via ASCEND_PROCESS_LOG_PATH (export == --env);
  add a 507018 triage table (deadlock-detect vs SPIN-timeout vs OS op-timeout vs
  forward-progress stall) so a generic host 507018 is classified from the device log.
- new dfx-analyze skill: reach for simpler's built-in DFX tools (device_log_timing,
  swimlane_converter, sched_overhead_analysis, deps_viewer, dump_viewer) instead of
  hand-rolling timing/instrumentation in the runtime.
- codestyle rule #7: never log on AICPU hot paths (floods device_log -> op-timeout,
  masking the behavior under study).
- multi-repo-setup: non-editable reinstall can silently skip the runtime .so rebuild;
  verify the built .so changed or cmake --build the cache + sync to both load locations.
ChaoWao added a commit that referenced this pull request Jul 29, 2026
…1578)

RemoteSocketTransport tests start a helper server thread, then construct a
RemoteL3SocketTransport whose constructor throws on a connect or HELLO
timeout — routine on a loaded box. The unwind destroyed the local
std::thread while it was still joinable, so std::terminate aborted the whole
binary mid-suite:

    #5  std::terminate ()
    #6  std::thread::~thread() ()
    #7  RemoteSocketTransport_ClosedPeerWriteDoesNotRaiseSigpipe_Test::TestBody()

Reproduced at 2/96 with 32 concurrent copies on a loaded 320-core box; the
run that aborts takes every other case in the binary with it, and the
message ("terminate called without an active exception", printed because no
handler has caught the in-flight exception yet) reads like a hang rather
than a timeout.

start_stalling_server also captured the test's stack std::atomic<bool> stop
flag by reference, so the same unwind left a running thread polling a dead
object.

ScopedServerThread owns both the thread and the stop flag, and joins in its
destructor, which closes both holes: the flag now outlives the thread, and
no unwind can reach a joinable std::thread.

Joining alone would swap the abort for a hang, because a thread parked in
accept() never returns when the client's connect is exactly what failed.
accept_until_stop polls the listener in 20 ms slices and rechecks the stop
flag, so stop_and_join always makes progress. It reads the flag only after
a poll slice, so a connection already pending still wins:
ClosedPeerWriteDoesNotRaiseSigpipe calls stop_and_join right after a
successful connect and depends on that connection being accepted and RST.

Add ServerThreadIsJoinedWhenTestBodyUnwinds, which throws out of a scope
holding a live server thread that never sees a client. It covers both
halves — reverted to the old bare-std::thread idiom it aborts with the
production message, and a join that could not reap a parked accept() would
trip its elapsed bound instead.

ut-cpp 65/65 green; 192 concurrent runs of the binary now abort 0 times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant