Skip to content
Open
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@
"core_type": "aic",
"signature": [D.IN, D.IN, D.OUT],
},
{
"func_id": 4,
"name": "AIC_HUB",
"source": str(_KERNELS_ROOT / "aic" / "aic_hub.cpp"),
"core_type": "aic",
"signature": [],
},
# AIV kernels (vector operations)
{
"func_id": 1,
Expand All @@ -75,13 +68,6 @@
"core_type": "aiv",
"signature": [D.IN, D.IN, D.IN, D.INOUT, D.INOUT, D.INOUT, D.INOUT],
},
{
"func_id": 5,
"name": "AIV_HUB",
"source": str(_KERNELS_ROOT / "aiv" / "aiv_hub.cpp"),
"core_type": "aiv",
"signature": [],
},
]

# Runtime configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#define FUNC_SOFTMAX_PREPARE 1
#define FUNC_PV_MATMUL 2
#define FUNC_ONLINE_UPDATE 3
#define FUNC_AIC_HUB 4
#define FUNC_AIV_HUB 5

extern "C" {

Expand Down Expand Up @@ -122,10 +120,10 @@ __attribute__((visibility("default"))) void aicpu_orchestration_entry(const Chip
params_hub.add_output(tile2d_ci);
params_hub.add_output(scalar_ci);
params_hub.add_output(scalar_ci);
TaskOutputTensors hub_outs = pto2_rt_submit_aiv_task(FUNC_AIV_HUB, params_hub);
const Tensor &oi_batch = hub_outs.get_ref(0);
const Tensor &li_batch = hub_outs.get_ref(1);
const Tensor &mi_batch = hub_outs.get_ref(2);
TaskOutputTensors state_outs = pto2_rt_materialize_output_tensors(params_hub);
const Tensor &oi_batch = state_outs.get_ref(0);
const Tensor &li_batch = state_outs.get_ref(1);
const Tensor &mi_batch = state_outs.get_ref(2);

for (uint64_t bn = 0; bn < max_bn; bn++) {
Arg params_qk;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@
"core_type": "aic",
"signature": [D.IN, D.IN, D.OUT],
},
{
"func_id": 4,
"name": "AIC_HUB",
"source": str(_PA_KERNELS / "aic" / "aic_hub.cpp"),
"core_type": "aic",
"signature": [],
},
{
"func_id": 1,
"name": "SF",
Expand All @@ -64,13 +57,6 @@
"core_type": "aiv",
"signature": [D.IN, D.IN, D.IN, D.INOUT, D.INOUT, D.INOUT, D.INOUT],
},
{
"func_id": 5,
"name": "AIV_HUB",
"source": str(_PA_KERNELS / "aiv" / "aiv_hub.cpp"),
"core_type": "aiv",
"signature": [],
},
]

# Runtime configuration
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@
"core_type": "aic",
"signature": [D.IN, D.IN, D.OUT],
},
{
"func_id": 4,
"name": "AIC_HUB",
"source": str(_KERNELS_ROOT / "aic" / "aic_hub.cpp"),
"core_type": "aic",
"signature": [],
},
# AIV kernels (vector operations)
{
"func_id": 1,
Expand All @@ -75,13 +68,6 @@
"core_type": "aiv",
"signature": [D.IN, D.IN, D.IN, D.INOUT, D.INOUT, D.INOUT, D.INOUT],
},
{
"func_id": 5,
"name": "AIV_HUB",
"source": str(_KERNELS_ROOT / "aiv" / "aiv_hub.cpp"),
"core_type": "aiv",
"signature": [],
},
]

# Runtime configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#define FUNC_SOFTMAX_PREPARE 1
#define FUNC_PV_MATMUL 2
#define FUNC_ONLINE_UPDATE 3
#define FUNC_AIC_HUB 4
#define FUNC_AIV_HUB 5

extern "C" {

Expand Down Expand Up @@ -125,10 +123,10 @@ __attribute__((visibility("default"))) void aicpu_orchestration_entry(const Chip
params_inplace.add_output(tile2d_ci);
params_inplace.add_output(scalar_ci);
params_inplace.add_output(scalar_ci);
TaskOutputTensors hub_outs = pto2_rt_submit_aiv_task(FUNC_AIV_HUB, params_inplace);
const Tensor &oi = hub_outs.get_ref(0);
const Tensor &li_update = hub_outs.get_ref(1);
const Tensor &mi_update = hub_outs.get_ref(2);
TaskOutputTensors state_outs = pto2_rt_materialize_output_tensors(params_inplace);
const Tensor &oi = state_outs.get_ref(0);
const Tensor &li_update = state_outs.get_ref(1);
const Tensor &mi_update = state_outs.get_ref(2);

for (uint64_t bn = 0; bn < bn_this_batch; bn++) {
uint32_t bt_idx[2] = {static_cast<uint32_t>(b_idx), static_cast<uint32_t>(bn)};
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@
"core_type": "aic",
"signature": [D.IN, D.IN, D.OUT],
},
{
"func_id": 4,
"name": "AIC_HUB",
"source": str(_KERNELS_ROOT / "aic" / "aic_hub.cpp"),
"core_type": "aic",
"signature": [],
},
# AIV kernels (vector operations)
{
"func_id": 1,
Expand All @@ -75,13 +68,6 @@
"core_type": "aiv",
"signature": [D.IN, D.IN, D.IN, D.INOUT, D.INOUT, D.INOUT, D.INOUT],
},
{
"func_id": 5,
"name": "AIV_HUB",
"source": str(_KERNELS_ROOT / "aiv" / "aiv_hub.cpp"),
"core_type": "aiv",
"signature": [],
},
]

# Runtime configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#define FUNC_SOFTMAX_PREPARE 1
#define FUNC_PV_MATMUL 2
#define FUNC_ONLINE_UPDATE 3
#define FUNC_AIC_HUB 4
#define FUNC_AIV_HUB 5

extern "C" {

Expand Down Expand Up @@ -125,10 +123,10 @@ __attribute__((visibility("default"))) void aicpu_orchestration_entry(const Chip
params_inplace.add_output(tile2d_ci);
params_inplace.add_output(scalar_ci);
params_inplace.add_output(scalar_ci);
TaskOutputTensors hub_outs = pto2_rt_submit_aiv_task(FUNC_AIV_HUB, params_inplace);
const Tensor &oi = hub_outs.get_ref(0);
const Tensor &li_update = hub_outs.get_ref(1);
const Tensor &mi_update = hub_outs.get_ref(2);
TaskOutputTensors state_outs = pto2_rt_materialize_output_tensors(params_inplace);
const Tensor &oi = state_outs.get_ref(0);
const Tensor &li_update = state_outs.get_ref(1);
const Tensor &mi_update = state_outs.get_ref(2);

for (uint64_t bn = 0; bn < bn_this_batch; bn++) {
uint32_t bt_idx[2] = {static_cast<uint32_t>(b_idx), static_cast<uint32_t>(bn)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef struct PTO2Runtime PTO2Runtime;
*/
typedef struct PTO2RuntimeOps {
SubmitResult (*submit_task)(PTO2Runtime *rt, const MixedKernels &mixed_kernels, const Arg &args);
SubmitResult (*materialize_output_tensors)(PTO2Runtime *rt, const Arg &args);
void (*add_dependency)(PTO2Runtime *rt, PTO2TaskId producer, PTO2TaskId consumer);
void (*scope_begin)(PTO2Runtime *rt);
void (*scope_end)(PTO2Runtime *rt);
Expand Down Expand Up @@ -98,6 +99,19 @@ static inline SubmitResult pto2_rt_submit_task(PTO2Runtime *rt, const MixedKerne
return rt->ops->submit_task(rt, mixed_kernels, args);
}

/**
* Materialize runtime-created OUTPUT tensors without dispatching a kernel.
*
* Returns SubmitResult so the pseudo task can still participate in explicit
* dependency wiring through task_id.
*
* Only OUTPUT tensor args are accepted. Inputs, inouts, and scalars are
* rejected as orchestration bugs.
*/
static inline SubmitResult pto2_rt_materialize_output_tensors(PTO2Runtime *rt, const Arg &args) {
return rt->ops->materialize_output_tensors(rt, args);
}

/**
* Convenience wrapper: submit an AIC-only task.
*/
Expand Down
Loading
Loading