xmos-ai-tools 1.3.2.dev108__py3-none-macosx_10_15_universal2.whl → 1.3.2.dev130__py3-none-macosx_10_15_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,9 +26,8 @@ typedef struct flash {
26
26
  typedef enum flash_command {
27
27
  FLASH_READ_PARAMETERS =
28
28
  0, ///< Read a set of parameters. // TODO: share with lib_tflite_micro
29
- FLASH_READ_MODEL = 1, ///< Read a whole model.
30
- FLASH_READ_OPERATORS =
31
- 2, ///< Read the binary for an operator - future extension
29
+ FLASH_READ_PARAMETERS_ASYNC = 1, ///< Read parameters asynchronously.
30
+ FLASH_READ_SYNCHRONIZE = 2, ///< Complete async read.
32
31
  FLASH_READ_XIP =
33
32
  3, ///< Read code to execute-in-place throught L2 cache - future extension
34
33
  FLASH_SERVER_QUIT = 4,
@@ -300,4 +300,8 @@ void mean_int8(const int8_t *input, int8_t *output, const int start_dim_size,
300
300
  const float in_zero_point, const float out_zero_point,
301
301
  const float scale_mul);
302
302
 
303
+ void mean_int16(const int16_t *input, int16_t *output, const int start_dim_size,
304
+ const int mean_dim_size, const int end_dim_size,
305
+ const float scale_mul);
306
+
303
307
  #endif // LAYERS_H_
@@ -3,6 +3,7 @@
3
3
 
4
4
  #include <quadflash.h>
5
5
 
6
+ #ifdef __XC__
6
7
  /** Fast flash library.
7
8
  * Before calling any of the functions in here, lib_quad_flash must be initialised as normal by using
8
9
  * fl_connectToDevice(qspi, flash_spec, n_flash_spec).
@@ -44,4 +45,9 @@ int fast_flash_init(fl_QSPIPorts &qspi);
44
45
  */
45
46
  void fast_flash_read(fl_QSPIPorts &qspi, unsigned addr, unsigned word_count, unsigned read_data[], chanend ?c_data_out);
46
47
 
48
+ #else
49
+ int fast_flash_init(fl_QSPIPorts *qspi);
50
+ void fast_flash_read(fl_QSPIPorts *qspi, unsigned addr, unsigned word_count, unsigned read_data[], chanend_t c_data_out);
51
+ #endif
52
+
47
53
  #endif
@@ -0,0 +1,64 @@
1
+ #ifndef _load_weights_h_
2
+ #define _load_weights_h_
3
+
4
+ #include <xcore/channel.h>
5
+ #include "thread_call.h"
6
+
7
+ #define LOAD_WEIGHTS_MAX_BLOCKS 2
8
+
9
+ /**
10
+ * Function that connects to a flash or tile-ram server and loads a series of weights.
11
+ * This function completes when the data is loaded.
12
+ *
13
+ * @param c_flash_or_tile channel-end connecting to the flash server
14
+ *
15
+ * @param data_ptr array of pointers where the loaded data should be scattered
16
+ *
17
+ * @param data_sizes_in_words number of words where for each block
18
+ *
19
+ * @param N number of blocks in data_ptr and data_sizes_in_words
20
+ *
21
+ * @param external_addr address in flash or tile ram
22
+ *
23
+ * @param model_thread_count number of threads available
24
+ *
25
+ * @param tif thread_info structure for multithreading
26
+ */
27
+ void load_weights_synchronous(chanend_t c_flash_or_tile, int *data_ptr[], int data_sizes_in_words[],
28
+ int N, int external_addr, int model_thread_count, thread_info_t *tif);
29
+
30
+ /**
31
+ * Function that connects to a flash server and loads a series of weights.
32
+ * This function continues loading after the call completes
33
+ *
34
+ * @param c_flash_or_tile channel-end connecting to the flash server
35
+ *
36
+ * @param data_ptr array of pointers where the loaded data should be scattered
37
+ *
38
+ * @param data_sizes_in_words number of words where for each block
39
+ *
40
+ * @param N number of blocks in data_ptr and data_sizes_in_words
41
+ *
42
+ * @param external_addr address in flash or tile ram
43
+ *
44
+ * @param model_thread_count number of threads available
45
+ */
46
+ void load_weights_asynchronous(chanend_t c_flash_or_tile, int *data_ptr[], int data_sizes_in_words[],
47
+ int N, int external_addr);
48
+
49
+ /**
50
+ * Function that connects to a flash server and waits for the last outstanding load to complete
51
+ * Only one asynchronous load should be outstanding at any one time.
52
+ *
53
+ * @param c_flash_or_tile channel-end connecting to the flash server
54
+ */
55
+ void load_weights_asynchronous_wait(chanend_t c_flash_or_tile);
56
+
57
+ /**
58
+ * Function that connects to a flash or tile ram server and kills it.
59
+ *
60
+ * @param c_flash_or_tile channel-end connecting to the flash server
61
+ */
62
+ void load_weights_quit(chanend_t c_flash_or_tile);
63
+
64
+ #endif
@@ -23,6 +23,7 @@ constexpr const char *XC_maxpool2d_OpCode = "XC_maxpool2d";
23
23
  constexpr const char *XC_softmax_OpCode = "XC_softmax";
24
24
  constexpr const char *XC_batched_softmax_OpCode = "XC_batched_softmax";
25
25
  constexpr const char *XC_ld_weights_OpCode = "XC_ld_weights";
26
+ constexpr const char *XC_ld_weights_wait_OpCode = "XC_ld_weights_wait";
26
27
  constexpr const char *XC_add_OpCode = "XC_add";
27
28
  constexpr const char *XC_slice_OpCode = "XC_slice";
28
29
  constexpr const char *XC_broadcast_OpCode = "XC_broadcast";
@@ -32,6 +33,7 @@ constexpr const char *XC_concat_OpCode = "XC_concat";
32
33
  constexpr const char *XC_pad_3_to_4_OpCode = "XC_pad_3_to_4";
33
34
  constexpr const char *XC_mul_OpCode = "XC_mul";
34
35
  constexpr const char *XC_mean_OpCode = "XC_mean";
36
+ constexpr const char *XC_meani16_OpCode = "XC_meani16";
35
37
  constexpr const char *XC_expand_8_to_16_OpCode = "XC_expand_8_to_16";
36
38
  // Binarized ops
37
39
  constexpr const char *XC_bsign_8_OpCode = "XC_bsign_8";
@@ -50,6 +52,7 @@ TFLMRegistration *Register_XC_maxpool2d();
50
52
  TFLMRegistration *Register_XC_softmax();
51
53
  TFLMRegistration *Register_XC_batched_softmax();
52
54
  TFLMRegistration *Register_XC_ld_weights();
55
+ TFLMRegistration *Register_XC_ld_weights_wait();
53
56
  TFLMRegistration *Register_XC_add();
54
57
  TFLMRegistration *Register_XC_slice();
55
58
  TFLMRegistration *Register_XC_broadcast();
@@ -59,6 +62,7 @@ TFLMRegistration *Register_XC_concat();
59
62
  TFLMRegistration *Register_XC_pad_3_to_4();
60
63
  TFLMRegistration *Register_XC_mul();
61
64
  TFLMRegistration *Register_XC_mean();
65
+ TFLMRegistration *Register_XC_meani16();
62
66
  TFLMRegistration *Register_XC_expand_8_to_16();
63
67
  // Binarized ops
64
68
  TFLMRegistration *Register_XC_bsign_8();
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xmos_ai_tools
3
- Version: 1.3.2.dev108
3
+ Version: 1.3.2.dev130
4
4
  Summary: XMOS AI Tools
5
5
  Home-page: https://github.com/xmos/ai_tools
6
6
  Author: XMOS
@@ -30,4 +30,4 @@ Requires-Dist: tflite>=2.4.0
30
30
  Documentation
31
31
  -------------
32
32
 
33
- Click [here](https://github.com/xmos/ai_tools/blob/ded91c91e745c004e545e25b7d5f1b5cd6b966dd/README.md) for documentation on using xmos-ai-tools to deploy AI models on xcore.
33
+ Click [here](https://github.com/xmos/ai_tools/blob/0a63d97853d80afa41f26f2b33eebca1d73a47e9/README.md) for documentation on using xmos-ai-tools to deploy AI models on xcore.
@@ -3,7 +3,7 @@ xmos_ai_tools/io_server/__init__.py,sha256=Wr8MHyIxhY80hnvwUH0AsE3BojqIt-AwbYBj-
3
3
  xmos_ai_tools/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  xmos_ai_tools/runtime/buildfiles/aitoolslib.cmake,sha256=7xlnDRNVsEIxu929Nt887drbV104t_Nsye1Rv_FpasA,478
5
5
  xmos_ai_tools/runtime/buildfiles/aitoolslib.make,sha256=D4GFs74BsWTuQT6R_yxXwR4LLH0pzyFiAXnGpe5hntI,253
6
- xmos_ai_tools/runtime/include/flash_server.h,sha256=zVvpbkae6VYa1Ybqu2PPuq3PvAJ07VF9pvXwWvkUCRI,3328
6
+ xmos_ai_tools/runtime/include/flash_server.h,sha256=4OQaauv9maSV9pFnxmf6R1LL_TzgnFdXeVPPVWSKPhU,3322
7
7
  xmos_ai_tools/runtime/include/ioserver.h,sha256=gEVBhuVLjwi9c00vHUKDEByibl6GVtSUpl5ePAk5GiE,1045
8
8
  xmos_ai_tools/runtime/include/tile_ram_server.h,sha256=Ad3XKz6sihH3Ot40cMAJmbmRlDo_GVbP51tCovYLm7Y,1546
9
9
  xmos_ai_tools/runtime/include/flatbuffers/allocator.h,sha256=7U_8vFjicWgq8yl-VXtF5JGX5mV7lXhS4aXkHI37XjA,2587
@@ -49,7 +49,7 @@ xmos_ai_tools/runtime/include/lib_nn/api/nn_bin_types.h,sha256=DTFX2ecfzwl-_tHlq
49
49
  xmos_ai_tools/runtime/include/lib_nn/api/nn_config.h,sha256=KFoA5zyOTTHi6x-qDuIWkF8wAz4Gc4BdOBgUzOArOD0,11558
50
50
  xmos_ai_tools/runtime/include/lib_nn/api/nn_conv2d_structs.h,sha256=Kfyq3bD1aLcSnWTB_cijU_D5ThGol5utJ1k-WsjqeMY,2268
51
51
  xmos_ai_tools/runtime/include/lib_nn/api/nn_image.h,sha256=gz7NyxmZACZiDED0wT7px2qjEEMcUwfa5TjeOUmYzL4,514
52
- xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h,sha256=FqXpBLsch_IDH1ssRsDO4zt3N8L8v-PbMddbiwY6DS4,10509
52
+ xmos_ai_tools/runtime/include/lib_nn/api/nn_layers.h,sha256=6vyEP1UTnuVqxCELCaCZx3L1kgMoVX4r20d4nucNZ0E,10696
53
53
  xmos_ai_tools/runtime/include/lib_nn/api/nn_op_helper.h,sha256=VMnBVEcgH0wtiiV91JjtFRG4xkCI0m7WrikEmU6ulss,3716
54
54
  xmos_ai_tools/runtime/include/lib_nn/api/nn_op_utils.h,sha256=zdCGBeyiHx4-T1hZ4Cjf-QTtXwIyWp4xzuI1dfOjHPA,4948
55
55
  xmos_ai_tools/runtime/include/lib_nn/api/nn_operator.h,sha256=Nj4jiXVHlnFjVBtV7mCGulTzSyNwCIpitz8Ao9kSIsU,337
@@ -71,8 +71,9 @@ xmos_ai_tools/runtime/include/lib_nn/api/xs3_vpu.h,sha256=xuEpNayaSWeEIoL1--EfQA
71
71
  xmos_ai_tools/runtime/include/lib_nn/api/xs3a_registers.h,sha256=5i6Tue1VplRI2VlIes-gaD2BXOKreuUit51OYTsbgFs,139774
72
72
  xmos_ai_tools/runtime/include/lib_nn/src/asm/asm_constants.h,sha256=VB8pk_H4vI4S18xYfPFCOGZoLG6S0FYW5uVfG3u9glU,1018
73
73
  xmos_ai_tools/runtime/include/lib_nn/src/asm/window_op_plan.h,sha256=4I5u3jkbPOXQnj073h24346uJTYApf0A2oegNc0TKjc,704
74
- xmos_ai_tools/runtime/include/lib_tflite_micro/api/fast_flash.h,sha256=IFDYtVg3AodzlFEQw_MFWs2fNQ43aMEXNVwpaG27sko,1984
74
+ xmos_ai_tools/runtime/include/lib_tflite_micro/api/fast_flash.h,sha256=ob6pARd2fzBAAvy8oDt8oROHzuL6e8VMoKkxmIxGx-Q,2175
75
75
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/inference_engine.h,sha256=GkmCI01aywc3docA7SV-11pSi89URw1ErxbaSkO9EIs,9303
76
+ xmos_ai_tools/runtime/include/lib_tflite_micro/api/load_weights.h,sha256=nzQ7lodtCKUpqCKHJ6f15RzaG5T2RO4FmAk_xN2P3js,2309
76
77
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/memory_parallel_transport.h,sha256=P6o4-yWfE3GW_R08zf_kTsg-h4589eAhg9lNvJA7ZCM,1932
77
78
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/version.h,sha256=ImFxGU2PzLZ3TzGiB1V2Ghgd2yh0qWR7UI7ao-MrG6w,318
78
79
  xmos_ai_tools/runtime/include/lib_tflite_micro/api/xcore_config.h,sha256=6KOImWQXzY6FXIepK746QlkQllmCo3eH5FD3Vp1x7PQ,519
@@ -83,7 +84,7 @@ xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/conv2d_f
83
84
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_custom_options.h,sha256=lC4Tw1Pxxg3zOXRdqNNtokuU-_cX9TTkYmGLe47-9dQ,630
84
85
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_error_reporter.h,sha256=_NIzvBYMqlwJexYESP5t5JXpxYTt-ZKq-1AdqAB9-Sc,812
85
86
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_interpreter.h,sha256=-0BNn65tzxWgNnHLolCYyUYhboL9nN3ksKni3BjH6QU,1801
86
- xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h,sha256=YdprKTg4PO0KdlW1RLfb9GYxzRoXmLVxsZb0wRafF6s,2781
87
+ xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_ops.h,sha256=74g-NaVsvtdW0-NzDDi0Hm5x_jzCbWswdiOZ1Vvjurs,2999
87
88
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_profiler.h,sha256=Ytqbj4TsbhZrtl42I2dgLyeloLi-1vZwjysIoOkgX9s,1239
88
89
  xmos_ai_tools/runtime/include/lib_tflite_micro/src/tflite-xcore-kernels/xcore_utils.h,sha256=CkxEhyN7i2rmlk_ua18XH1XDV_E4mS2u3Ph48mIhN7M,4747
89
90
  xmos_ai_tools/runtime/include/lib_xud/lib_xud/api/xud.h,sha256=aQNbN6EvpVQm-OkgE_JGn2SeqYE_sKtwWZebu50IwnE,20701
@@ -378,17 +379,17 @@ xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/metrics.h
378
379
  xmos_ai_tools/runtime/include/tensorflow/lite/micro/tools/benchmarking/op_resolver.h,sha256=g0dl9tzUqngiINvjBlqDclFqvkC85MC4kbU13vE4OkY,6071
379
380
  xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_generated.h,sha256=OzGCvswrW_FArm-HxD70BExn0PVtBbHAFPDO6ZZOFtc,1093177
380
381
  xmos_ai_tools/runtime/include/tensorflow/lite/schema/schema_utils.h,sha256=tkHMDPARjIqppYCVInIowwdHxjNP3pfSS9O7vx-ODeo,1333
381
- xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a,sha256=sgtO2Cb3dJ3Dps2c0Ly3ZQjkzmfALm6GdyQcTo53w4M,2431256
382
- xmos_ai_tools/runtime/lib/libxtflitemicro.a,sha256=lvrVMYJaYvmS9p5q7gM4NExtleEPkKO-563f4Xia8G8,70440318
382
+ xmos_ai_tools/runtime/lib/libhost_xtflitemicro.a,sha256=XkbCyd89vFCKkVCfmC1YG1mwFB1XM4jQoAgdCd7QbYQ,2444504
383
+ xmos_ai_tools/runtime/lib/libxtflitemicro.a,sha256=SEjEdJfA1574FLgZXrlZb-UY3PC6pxNKt7TLJPccTKU,71011174
383
384
  xmos_ai_tools/xformer/__init__.py,sha256=AxzDorvqJ0FiTc4CLecHPwbMkSuWzXGZT2-u72Aau5s,1904
384
385
  xmos_ai_tools/xformer/flash.py,sha256=MG4coi_Lvvg-oQmw1pomJD8eeOH4gAMjixjBFvO2BCk,6376
385
386
  xmos_ai_tools/xinterpreters/__init__.py,sha256=PFRB9VxOLKaA--j2ZvWGcmesv2C6uNYqJ_kBam68aUI,50
386
387
  xmos_ai_tools/xinterpreters/exceptions.py,sha256=HOjADxHYMPI9mN0YIbWxtw9hSeL2B6XWWwqtGtyJdVs,577
387
388
  xmos_ai_tools/xinterpreters/host_interpreter.py,sha256=rqoTcSWK7O9eboMsg0o2UYWapWTE5xiki7XTJZ_JbwQ,25664
388
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib,sha256=uwA1dNlFvRyw-lyg7msQ2P_vi6syL4OGWWZj8pa3fWE,2321592
389
- xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib,sha256=uwA1dNlFvRyw-lyg7msQ2P_vi6syL4OGWWZj8pa3fWE,2321592
390
- xmos_ai_tools-1.3.2.dev108.data/data/bin/xcore-opt,sha256=lJwRhCr3bwJVK_KXrVEDVJJ0YWt44SMkiSMyOqO4EBE,283342392
391
- xmos_ai_tools-1.3.2.dev108.dist-info/METADATA,sha256=VGPXQn2iVk0xtn3nQX4zcb5LNLYZrX-aWpt72YRRerc,1342
392
- xmos_ai_tools-1.3.2.dev108.dist-info/WHEEL,sha256=cblCMhPsi-5aS-1Fj5LRCkSbCUQwa2nrUvkiKN0vRpQ,113
393
- xmos_ai_tools-1.3.2.dev108.dist-info/top_level.txt,sha256=YWegea73ll3tMlRWRdHJemUy2VOuEYDdOIaffxu_eF0,14
394
- xmos_ai_tools-1.3.2.dev108.dist-info/RECORD,,
389
+ xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.1.0.1.dylib,sha256=xcME5ehmtbFbGerwzFm2CQ5vWtPS5cKVIfb2TQyqK-8,2339144
390
+ xmos_ai_tools/xinterpreters/libs/macos/xtflm_python.dylib,sha256=xcME5ehmtbFbGerwzFm2CQ5vWtPS5cKVIfb2TQyqK-8,2339144
391
+ xmos_ai_tools-1.3.2.dev130.data/data/bin/xcore-opt,sha256=k_xbqK2fSPS1GUytOMPvxhrTN6T4c7kQBMzeGdO58wk,283735176
392
+ xmos_ai_tools-1.3.2.dev130.dist-info/METADATA,sha256=nFX7nGOiOUi_6yBIuzsxUlPyMCBAUYQAVAmoZbk0G48,1342
393
+ xmos_ai_tools-1.3.2.dev130.dist-info/WHEEL,sha256=cblCMhPsi-5aS-1Fj5LRCkSbCUQwa2nrUvkiKN0vRpQ,113
394
+ xmos_ai_tools-1.3.2.dev130.dist-info/top_level.txt,sha256=YWegea73ll3tMlRWRdHJemUy2VOuEYDdOIaffxu_eF0,14
395
+ xmos_ai_tools-1.3.2.dev130.dist-info/RECORD,,