fixstars / ion-kit

Modernized graph-based data processing framework
MIT License
7 stars 6 forks source link

Graph python binding #246

Closed xinyuli1204 closed 6 months ago

xinyuli1204 commented 7 months ago

implement python binding for Graph api

xinyuli1204 commented 7 months ago

duplicate name error

xinyuli@xinyus-air test % ./c_api_jit                                       
[2024-02-28 10:22:39.367] [ion] [debug] ion-kit version is v1.6.0-40-g17f645c
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_0 as input on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_1 as min0 on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_2 as extent0 on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_3 as min1 on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_4 as extent1 on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.368] [ion] [debug] Determine free port _ion_iport_5 as v on Node de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.369] [ion] [debug] Port d95e4ba0-4a3b-498d-bc5d-a3aa7c60dbcd is not found
[2024-02-28 10:22:39.369] [ion] [debug] Port d95e4ba0-4a3b-498d-bc5d-a3aa7c60dbcd is found
[2024-02-28 10:22:39.369] [ion] [debug] Port 89c31243-02bd-480a-aa46-a0a5ce61d861 is not found
[2024-02-28 10:22:39.369] [ion] [debug] Port 26b01ce3-98a5-4b55-9480-bfd7f8140002 is not found
[2024-02-28 10:22:39.369] [ion] [debug] Port fed4a4d7-de6c-461d-b86e-f7a480505511 is not found
[2024-02-28 10:22:39.369] [ion] [debug] Port ffd09461-2983-4c86-bdee-be1d9e520a80 is not found
[2024-02-28 10:22:39.369] [ion] [debug] Port db8b6ebc-54cf-4e57-a135-33b8896b8405 is not found
[2024-02-28 10:22:39.369] [ion] [info] Start building pipeline
[2024-02-28 10:22:39.370] [ion] [info] Builder::register_disposer
[2024-02-28 10:22:39.658] [ion] [info] consume_dispose is called with id=de6ebc65-e035-402f-bb12-de4384751e32
[2024-02-28 10:22:39.658] [ion] [info] Start building pipeline
[2024-02-28 10:22:39.658] [ion] [debug] Determine free port _ion_iport_0 as input on Node 2001e0ad-a7df-4940-aca2-f820554695f1
[2024-02-28 10:22:39.831] [ion] [debug] Inserted "__input0" instance at #0
[2024-02-28 10:22:39.831] [ion] [debug] Inferred arguments stub
[2024-02-28 10:22:39.831] [ion] [debug]   #0 name(__input0) kind(InputBuffer) dimensions(2) type(int32_t)
[2024-02-28 10:22:39.831] [ion] [debug] Generating arguments instance
[2024-02-28 10:22:39.831] [ion] [debug]   #0 0x6000026a0020
[2024-02-28 10:22:39.831] [ion] [debug]   #1 0x6000026a00d0
[2024-02-28 10:22:39.831] [ion] [info] Start building pipeline
[2024-02-28 10:22:39.831] [ion] [debug] Determine free port _ion_iport_0 as input on Node 4d1b595e-abcd-4234-a3a0-822d05d2b661
[2024-02-28 10:22:39.857] [ion] [debug] Inserted "__input0" instance at #0
[2024-02-28 10:22:39.857] [ion] [debug] Inferred arguments stub
[2024-02-28 10:22:39.857] [ion] [debug]   #0 name(__input0) kind(InputBuffer) dimensions(2) type(int32_t)
[2024-02-28 10:22:39.857] [ion] [debug] Generating arguments instance
[2024-02-28 10:22:39.857] [ion] [debug]   #0 0x6000026cc020
[2024-02-28 10:22:39.857] [ion] [debug]   #1 0x6000026cc0d0
[2024-02-28 10:22:39.857] [ion] [info] Start building pipeline
[2024-02-28 10:22:39.857] [ion] [debug] Determine free port _ion_iport_0 as input on Node 8e39382b-9170-4138-ba56-e4e3b30a198c
[2024-02-28 10:22:39.883] [ion] [debug] Inserted "__input0" instance at #0
[2024-02-28 10:22:39.883] [ion] [debug] Inferred arguments stub
[2024-02-28 10:22:39.883] [ion] [debug]   #0 name(__input0) kind(InputBuffer) dimensions(2) type(int32_t)
[2024-02-28 10:22:39.883] [ion] [debug] Generating arguments instance
[2024-02-28 10:22:39.883] [ion] [debug]   #0 0x6000026f00d0
[2024-02-28 10:22:39.883] [ion] [debug]   #1 0x6000026f0020
[2024-02-28 10:22:39.883] [ion] [info] Start building pipeline
[2024-02-28 10:22:39.885] [ion] [error] Error: All Params and embedded Buffers must have unique names, but the name '__input0' was seen multiple times.

first graph g0 has one node("test_inc_i32x2") and it has input named "input" second graph g21has one node("test_inc_i32x2") and it has input named "input" third graph g2 = g1 + g0

it throws this error [2024-02-28 10:22:39.885] [ion] [error] Error: All Params and embedded Buffers must have unique names, but the name '__input0' was seen multiple times.

xinyuli1204 commented 7 months ago
class Inc : public BuildingBlock<Inc<T, D>> {
public:
    Input<Halide::Func> input{"input", Halide::type_of<T>(), D};
    Output<Halide::Func> output{"output", Halide::type_of<T>(), D};
iitaku commented 6 months ago

Resolved in #252