[GitHub] [incubator-mxnet] leezu commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC
leezu commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC URL: https://github.com/apache/incubator-mxnet/issues/17613#issuecomment-586867768 The static build scripts have been updated to avoid AVX instructions. Try running the `CMAKE_STATICBUILD=1 tools/staticbuild/build.sh cpu` as per the instructions in https://github.com/apache/incubator-mxnet/tree/master/tools/staticbuild Alternatively you can directly compile on the NUC and the compiler will refrain from using AVX if the processor doesn't support it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] gachiemchiep commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC
gachiemchiep commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC URL: https://github.com/apache/incubator-mxnet/issues/17613#issuecomment-586868723 Hello, @leezu . Is the staticbuild tool support cross-compiling for the NUC? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] vexilligera opened a new pull request #17614: [NumPy] Add NumPy support for triu
vexilligera opened a new pull request #17614: [NumPy] Add NumPy support for triu URL: https://github.com/apache/incubator-mxnet/pull/17614 ## Description ## This is directly modified from np.tril ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes) - [ ] Changes are complete (i.e. I finished coding on this PR) - [ ] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [ ] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - [ ] Feature1, tests, (and when applicable, API doc) - [ ] Feature2, tests, (and when applicable, API doc) ## Comments ## - If this change is a backward incompatible change, why must this change be made. - Interesting edge cases to note here This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] wkcn commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation
wkcn commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation URL: https://github.com/apache/incubator-mxnet/pull/17510#discussion_r380056875 ## File path: include/mxnet/runtime/packed_func.h ## @@ -0,0 +1,1254 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * \file runtime/packed_func.h + * \brief Adapted from incubator-tvm/include/tvm/runtime/packed_func.h + * Type-erased function used across MXNET API. + */ +#ifndef MXNET_RUNTIME_PACKED_FUNC_H_ +#define MXNET_RUNTIME_PACKED_FUNC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mxnet { +// forward declarations +// class Integer; +// class Expr; + +namespace runtime { + +/*! + * \brief Runtime utility for getting custom type name from code + * \param type_code Custom type code + * \return Custom type name + */ +// MXNET_DLL std::string GetCustomTypeName(uint8_t type_code); + +/*! + * \brief Runtime utility for checking whether custom type is registered + * \param type_code Custom type code + * \return Bool representing whether type is registered + */ +// MXNET_DLL bool GetCustomTypeRegistered(uint8_t type_code); + +/*! + * \brief Runtime utility for parsing string of the form "custom[]" + * \param s String to parse + * \param scan pointer to parsing pointer, which is scanning across s + * \return type code of custom type parsed + */ +// MXNET_DLL uint8_t ParseCustomDatatype(const std::string& s, const char** scan); + +/*! + * \brief convert a string to TVM type. + * \param s The string to be converted. + * \return The corresponding tvm type. + */ +inline DLDataType String2DLDataType(std::string s); + +// forward declarations +class MXNetArgs; +class MXNetArgValue; +class MXNetRetValue; +class MXNetArgsSetter; + +/*! + * \brief Packed function is a type-erased function. + * The arguments are passed by packed format. + * + * This is an useful unified interface to call generated functions, + * It is the unified function function type of TVM. + * It corresponds to TVMFunctionHandle in C runtime API. + */ +class PackedFunc { + public: + /*! + * \brief The internal std::function + * \param args The arguments to the function. + * \param rv The return value. + * + * \code + * // Example code on how to implemented FType + * void MyPackedFunc(MXNetArgs args, MXNetRetValue* rv) { + * // automatically convert arguments to desired type. + * int a0 = args[0]; + * float a1 = args[1]; + * ... + * // automatically assign values to rv + * std::string my_return_value = "x"; + * *rv = my_return_value; + * } + * \endcode + */ + using FType = std::function; Review comment: @hzfan Thank you! Yes. In the application A, we can call `MXNetFuncCall` to call the PackedFunc, call `MXNetFuncFree` to free the PackedFunc, and call `MXNetFuncCreateFromCFunc` like [TVMFuncCreateFromCFunc](https://github.com/apache/incubator-tvm/blob/a43e326fb0250a46c61f726a4633633c2af2bf03/include/tvm/runtime/c_runtime_api.h#L340) in TVM to create new PackedFunc. However, when the implementations of `std::function` are different between MXNet and the application A, A could not call PackedFunc directly, namely ```c++ PackedFunc *func = GetAPackedFuncFromMXNet(); (*func)(a, b, c); ``` Besides, A could not pass its PackedFunc to MXNet directly, namely ```c++ PackedFunc func = GetAPackedFuncFromA(); MXNetFuncCall(&func, xxx); ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] szandara edited a comment on issue #14488: big different between usage of GPU's memory on c++ and python
szandara edited a comment on issue #14488: big different between usage of GPU's memory on c++ and python URL: https://github.com/apache/incubator-mxnet/issues/14488#issuecomment-586732779 Can you explain why the C API solves the problem? I have the same issue and I am unable to run my network. If I use Python the memory usage is 2.7GB while using the C++ interfaces causes a cudaMalloc error. Memory spikes to 11GB and then it crashes. (I have a 12GB Nvidia GPU!) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] hzfan commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation
hzfan commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation URL: https://github.com/apache/incubator-mxnet/pull/17510#discussion_r380088099 ## File path: include/mxnet/runtime/packed_func.h ## @@ -0,0 +1,1254 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * \file runtime/packed_func.h + * \brief Adapted from incubator-tvm/include/tvm/runtime/packed_func.h + * Type-erased function used across MXNET API. + */ +#ifndef MXNET_RUNTIME_PACKED_FUNC_H_ +#define MXNET_RUNTIME_PACKED_FUNC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mxnet { +// forward declarations +// class Integer; +// class Expr; + +namespace runtime { + +/*! + * \brief Runtime utility for getting custom type name from code + * \param type_code Custom type code + * \return Custom type name + */ +// MXNET_DLL std::string GetCustomTypeName(uint8_t type_code); + +/*! + * \brief Runtime utility for checking whether custom type is registered + * \param type_code Custom type code + * \return Bool representing whether type is registered + */ +// MXNET_DLL bool GetCustomTypeRegistered(uint8_t type_code); + +/*! + * \brief Runtime utility for parsing string of the form "custom[]" + * \param s String to parse + * \param scan pointer to parsing pointer, which is scanning across s + * \return type code of custom type parsed + */ +// MXNET_DLL uint8_t ParseCustomDatatype(const std::string& s, const char** scan); + +/*! + * \brief convert a string to TVM type. + * \param s The string to be converted. + * \return The corresponding tvm type. + */ +inline DLDataType String2DLDataType(std::string s); + +// forward declarations +class MXNetArgs; +class MXNetArgValue; +class MXNetRetValue; +class MXNetArgsSetter; + +/*! + * \brief Packed function is a type-erased function. + * The arguments are passed by packed format. + * + * This is an useful unified interface to call generated functions, + * It is the unified function function type of TVM. + * It corresponds to TVMFunctionHandle in C runtime API. + */ +class PackedFunc { + public: + /*! + * \brief The internal std::function + * \param args The arguments to the function. + * \param rv The return value. + * + * \code + * // Example code on how to implemented FType + * void MyPackedFunc(MXNetArgs args, MXNetRetValue* rv) { + * // automatically convert arguments to desired type. + * int a0 = args[0]; + * float a1 = args[1]; + * ... + * // automatically assign values to rv + * std::string my_return_value = "x"; + * *rv = my_return_value; + * } + * \endcode + */ + using FType = std::function; Review comment: @wkcn Thanks for bringing this up. Yes, I agree that the above two cases trigger unexpected errors. In the first case, PackedFunc is exposed to A, which is not intended. Also, in this pr, application A is basically cython. As can be seen from `function.pxi` and `convert.pxi`, PackedFunc is not exposed to cython. So the first case does not occur in this pr. As for the second case, currently this FFI does not support receiving callback functions from outside of MXNet (`MXNetFuncCreateFromCFunc` does not exist). So the second case does not occur either. Generally in this pr PackedFunc is called through the intended `MXNetFuncCall`, which ensures the ABI-compatibility. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] wkcn commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation
wkcn commented on a change in pull request #17510: MXNet FFI for Operator Imperative Invocation URL: https://github.com/apache/incubator-mxnet/pull/17510#discussion_r380126125 ## File path: include/mxnet/runtime/packed_func.h ## @@ -0,0 +1,1254 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/*! + * \file runtime/packed_func.h + * \brief Adapted from incubator-tvm/include/tvm/runtime/packed_func.h + * Type-erased function used across MXNET API. + */ +#ifndef MXNET_RUNTIME_PACKED_FUNC_H_ +#define MXNET_RUNTIME_PACKED_FUNC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mxnet { +// forward declarations +// class Integer; +// class Expr; + +namespace runtime { + +/*! + * \brief Runtime utility for getting custom type name from code + * \param type_code Custom type code + * \return Custom type name + */ +// MXNET_DLL std::string GetCustomTypeName(uint8_t type_code); + +/*! + * \brief Runtime utility for checking whether custom type is registered + * \param type_code Custom type code + * \return Bool representing whether type is registered + */ +// MXNET_DLL bool GetCustomTypeRegistered(uint8_t type_code); + +/*! + * \brief Runtime utility for parsing string of the form "custom[]" + * \param s String to parse + * \param scan pointer to parsing pointer, which is scanning across s + * \return type code of custom type parsed + */ +// MXNET_DLL uint8_t ParseCustomDatatype(const std::string& s, const char** scan); + +/*! + * \brief convert a string to TVM type. + * \param s The string to be converted. + * \return The corresponding tvm type. + */ +inline DLDataType String2DLDataType(std::string s); + +// forward declarations +class MXNetArgs; +class MXNetArgValue; +class MXNetRetValue; +class MXNetArgsSetter; + +/*! + * \brief Packed function is a type-erased function. + * The arguments are passed by packed format. + * + * This is an useful unified interface to call generated functions, + * It is the unified function function type of TVM. + * It corresponds to TVMFunctionHandle in C runtime API. + */ +class PackedFunc { + public: + /*! + * \brief The internal std::function + * \param args The arguments to the function. + * \param rv The return value. + * + * \code + * // Example code on how to implemented FType + * void MyPackedFunc(MXNetArgs args, MXNetRetValue* rv) { + * // automatically convert arguments to desired type. + * int a0 = args[0]; + * float a1 = args[1]; + * ... + * // automatically assign values to rv + * std::string my_return_value = "x"; + * *rv = my_return_value; + * } + * \endcode + */ + using FType = std::function; Review comment: @hzfan I see. Thank you for the detailed explaination : ) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] TaoLv commented on a change in pull request #17318: Enable MKL-DNN FullyConnected backward
TaoLv commented on a change in pull request #17318: Enable MKL-DNN FullyConnected backward URL: https://github.com/apache/incubator-mxnet/pull/17318#discussion_r380159023 ## File path: tests/cpp/include/test_mkldnn.h ## @@ -63,24 +63,24 @@ struct TestArrayShapes { }; // Init arrays with the default layout. -inline static void InitDefaultArray(NDArray *arr, bool is_rand = false) { +inline static void InitDefaultArray(NDArray *arr, bool is_rand = false, int max = 50) { const TBlob &blob = arr->data(); mshadow::default_real_t *data = blob.dptr(); int size = blob.Size(); for (int i = 0; i < size; i++) if (is_rand) { - data[i] = (std::rand() % 100) - 50; + data[i] = (std::rand() % (max * 2)) - max; Review comment: I have reverted the changes for floating numbers. Changing ``memcmp` to `AssertEqual` is out of the scope of this PR, so I will keep it as is. > Or we can just increase max to filling more different numbers other than only -1 and 0. I was thinking about including number 2 into the generated tensor but found that with the given shapes, there still has chance to get error. That means for the worst case, the intermediate accumulation value will be > 2^24, so the 1 will be ignored when accumulating another 1 to it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet-site] branch asf-site updated: Bump the publish timestamp.
This is an automated email from the ASF dual-hosted git repository. aaronmarkham pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git The following commit(s) were added to refs/heads/asf-site by this push: new c19cd7e Bump the publish timestamp. c19cd7e is described below commit c19cd7e5153d5ef7f6271c935a465c7787c122eb Author: mxnet-ci AuthorDate: Mon Feb 17 12:42:52 2020 + Bump the publish timestamp. --- date.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/date.txt b/date.txt new file mode 100644 index 000..51fdc4c --- /dev/null +++ b/date.txt @@ -0,0 +1 @@ +Mon Feb 17 12:42:52 UTC 2020
[GitHub] [incubator-mxnet] Alicia1529 opened a new pull request #17615: [Numpy] add op ediff1d
Alicia1529 opened a new pull request #17615: [Numpy] add op ediff1d URL: https://github.com/apache/incubator-mxnet/pull/17615 ## Description ## add numpy op ediff1d This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587020032 I'm the same person as @kpu but work part time as @kpuatamazon. Typically you'll hear from my Amazon hat on Mondays, though I plan to work flexibly to respond more quickly. Overall, I think this is going to come down to an end-to-end benchmark. Here's some numbers from a c5.12xlarge (with VNNI). Sockeye in fp32 on one core: ``` real14m21.688s user14m24.608s sys 0m1.329s ``` Sockeye in int8 (intgemm) on one core: ``` real5m2.986s user5m6.203s sys 0m1.036s ``` And BLEU was unchanged (it went up 0.1% oddly). I'll work on how much time is spent in GEMM and a version backed with DNNL. > Also, the intgemm library seems to be a personal project more than a product. I'm not sure how will it be maintained and what's the adoption status in other projects. > What's the adoption status of the library? And who will maintain the library? Amazon or @kpuatamazon himself? The intgemm library started as code inside the Marian machine translation project https://marian-nmt.github.io/ . It's been extracted as a standalone. Marian is run in production at Microsoft, the European Union, World Intellectual Property Organization, US Air Force, and others listed on the site. I've introduced @pengzhao-intel to our collaborators at Intel, which has funded some of the development. I coordinate a 3-year EUR 3 million project funded by the EU to add client-side machine translation to web browsers https://browser.mt/ https://www.zdnet.com/article/firefox-to-get-page-translation-feature-like-chrome/ . This project is using Marian. Since we want to run on people's desktops, intgemm is mostly optimized for pre-VNNI CPUs though we have VNNI support and further register optimization in a branch. > Could you please be more specific what the functionality is? > If possible, please share more about how you did the quantization in your gluon model. I'm calling the quantization operators directly from gluon instead of doing a graph transformation. Please see the Sockeye code that uses this pull request. The code is in https://github.com/awslabs/sockeye/pull/771 and https://github.com/kpuatamazon/sockeye/tree/heafield-quantize This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] Acrobot commented on issue #17513: Correct the grammar in 1-ndarray tutorial
Acrobot commented on issue #17513: Correct the grammar in 1-ndarray tutorial URL: https://github.com/apache/incubator-mxnet/pull/17513#issuecomment-587034410 @aaronmarkham I am unsure why the approval does not pass on centos-gpu, could you please take a look at it? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] Acrobot edited a comment on issue #17513: Correct the grammar in 1-ndarray tutorial
Acrobot edited a comment on issue #17513: Correct the grammar in 1-ndarray tutorial URL: https://github.com/apache/incubator-mxnet/pull/17513#issuecomment-587034410 @aaronmarkham I am unsure why the approval does not pass on centos-gpu, could you please take a look at it or alternatively override the check? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587066870 The current MXNet quantizer is 3-10x slower than intgemm's on a wide variety of matrix sizes. Experiment on c5.12xlarge: ``` Shape (128, 128) 0.731 seconds for quantize 0.706 seconds for quantize_v2 0.219 seconds for intgemm intgemm is 3.2x faster Shape (256, 256) 0.0002116 seconds for quantize 0.0001778 seconds for quantize_v2 0.258 seconds for intgemm intgemm is 6.9x faster Shape (512, 512) 0.0008112 seconds for quantize 0.0006480 seconds for quantize_v2 0.917 seconds for intgemm intgemm is 7.1x faster Shape (1024, 1024) 0.0030176 seconds for quantize 0.0023387 seconds for quantize_v2 0.0002542 seconds for intgemm intgemm is 9.2x faster Shape (2048, 2048) 0.0118271 seconds for quantize 0.0090704 seconds for quantize_v2 0.0008705 seconds for intgemm intgemm is 10.4x faster Shape (8, 4096) 0.0001187 seconds for quantize 0.0001061 seconds for quantize_v2 0.226 seconds for intgemm intgemm is 4.7x faster ``` Generated by `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=1; taskset --cpu-list 0 ./quant_bench.py` where `quant_bench.py` is: ``` #!/usr/bin/env python3 import mxnet as mx import time def time_procedure(shape, count, proc): data = mx.nd.random_uniform(shape=s, low=-1.0, high = 1.0) mx.nd.waitall() begin = time.time() for i in range(0, count): proc(data) mx.nd.waitall() return (time.time() - begin) / count shapes = [(128, 128), (256,256), (512, 512), (1024, 1024), (2048, 2048)] count = 1000 one = mx.nd.ones(shape=(1)) minusone = -one procedures = { "quantize" : (lambda data : mx.nd.contrib.quantize(data, minusone, one)), "quantize_v2" : (lambda data : mx.nd.contrib.quantize_v2(data, min_calib_range = -1.0, max_calib_range = 1.0)), "intgemm" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, one)) } for s in shapes: print("Shape " + str(s)) stats = {} for name, l in procedures.items(): stats[name] = time_procedure(s, count, l) print("{:.7f} seconds for {}".format(stats[name], name)) best_baseline = min(stats["quantize"], stats["quantize_v2"]) ratio = best_baseline / stats["intgemm"] print("intgemm is {:.1f}x faster".format(ratio)) ``` As a C++ programmer used to benchmarking with `clock_gettime`, using Python to do benchmarks pains me, but I think the point is clear. If anything I'm handicapped on small matrices due to Python overhead. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587066870 The current MXNet quantizer is 3-10x slower than intgemm's on a wide variety of matrix sizes. Experiment on c5.12xlarge: ``` Shape (128, 128) 0.731 seconds for quantize 0.706 seconds for quantize_v2 0.219 seconds for intgemm intgemm is 3.2x faster Shape (256, 256) 0.0002116 seconds for quantize 0.0001778 seconds for quantize_v2 0.258 seconds for intgemm intgemm is 6.9x faster Shape (512, 512) 0.0008112 seconds for quantize 0.0006480 seconds for quantize_v2 0.917 seconds for intgemm intgemm is 7.1x faster Shape (1024, 1024) 0.0030176 seconds for quantize 0.0023387 seconds for quantize_v2 0.0002542 seconds for intgemm intgemm is 9.2x faster Shape (2048, 2048) 0.0118271 seconds for quantize 0.0090704 seconds for quantize_v2 0.0008705 seconds for intgemm intgemm is 10.4x faster Shape (8, 4096) 0.0001187 seconds for quantize 0.0001061 seconds for quantize_v2 0.226 seconds for intgemm intgemm is 4.7x faster ``` Generated by `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=1; taskset --cpu-list 0 ./quant_bench.py` where `quant_bench.py` is: ``` #!/usr/bin/env python3 import mxnet as mx import time def time_procedure(shape, count, proc): data = mx.nd.random_uniform(shape=s, low=-1.0, high = 1.0) mx.nd.waitall() begin = time.time() for i in range(0, count): proc(data) mx.nd.waitall() return (time.time() - begin) / count shapes = [(128, 128), (256,256), (512, 512), (1024, 1024), (2048, 2048)] count = 1000 one = mx.nd.ones(shape=(1)) minusone = -one procedures = { "quantize" : (lambda data : mx.nd.contrib.quantize(data, minusone, one)), "quantize_v2" : (lambda data : mx.nd.contrib.quantize_v2(data, min_calib_range = -1.0, max_calib_range = 1.0)), "intgemm" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, one)) } for s in shapes: print("Shape " + str(s)) stats = {} for name, l in procedures.items(): stats[name] = time_procedure(s, count, l) print("{:.7f} seconds for {}".format(stats[name], name)) best_baseline = min(stats["quantize"], stats["quantize_v2"]) ratio = best_baseline / stats["intgemm"] print("intgemm is {:.1f}x faster".format(ratio)) ``` As a C++ programmer used to benchmarking with `clock_gettime`, using Python to do benchmarks pains me, but I think the point is clear. If anything the Python overhead is pushing results towards 1 by adding to numerator and denominator. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587066870 The current MXNet quantizer is 3-10x slower than intgemm's on a wide variety of matrix sizes. Experiment on c5.12xlarge: ``` Shape (128, 128) 0.731 seconds for quantize 0.706 seconds for quantize_v2 0.219 seconds for intgemm intgemm is 3.2x faster Shape (256, 256) 0.0002116 seconds for quantize 0.0001778 seconds for quantize_v2 0.258 seconds for intgemm intgemm is 6.9x faster Shape (512, 512) 0.0008112 seconds for quantize 0.0006480 seconds for quantize_v2 0.917 seconds for intgemm intgemm is 7.1x faster Shape (1024, 1024) 0.0030176 seconds for quantize 0.0023387 seconds for quantize_v2 0.0002542 seconds for intgemm intgemm is 9.2x faster Shape (2048, 2048) 0.0118271 seconds for quantize 0.0090704 seconds for quantize_v2 0.0008705 seconds for intgemm intgemm is 10.4x faster Shape (8, 4096) 0.0001187 seconds for quantize 0.0001061 seconds for quantize_v2 0.226 seconds for intgemm intgemm is 4.7x faster ``` Generated by `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=1; taskset --cpu-list 0 ./quant_bench.py` where `quant_bench.py` is: ```python #!/usr/bin/env python3 import mxnet as mx import time def time_procedure(shape, count, proc): data = mx.nd.random_uniform(shape=s, low=-1.0, high = 1.0) mx.nd.waitall() begin = time.time() for i in range(0, count): proc(data) mx.nd.waitall() return (time.time() - begin) / count shapes = [(128, 128), (256,256), (512, 512), (1024, 1024), (2048, 2048)] count = 1000 one = mx.nd.ones(shape=(1)) minusone = -one procedures = { "quantize" : (lambda data : mx.nd.contrib.quantize(data, minusone, one)), "quantize_v2" : (lambda data : mx.nd.contrib.quantize_v2(data, min_calib_range = -1.0, max_calib_range = 1.0)), "intgemm" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, one)) } for s in shapes: print("Shape " + str(s)) stats = {} for name, l in procedures.items(): stats[name] = time_procedure(s, count, l) print("{:.7f} seconds for {}".format(stats[name], name)) best_baseline = min(stats["quantize"], stats["quantize_v2"]) ratio = best_baseline / stats["intgemm"] print("intgemm is {:.1f}x faster".format(ratio)) ``` As a C++ programmer used to benchmarking with `clock_gettime`, using Python to do benchmarks pains me, but I think the point is clear. If anything the Python overhead is pushing results towards 1 by adding to numerator and denominator. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587073135 Also, OMP performance is very bad. (NB: intgemm is running single-threaded here, partly because OMP is bad at this problem) ```bash export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=2; taskset --cpu-list 0,1 ./quant_bench.py ``` ``` [16:18:40] src/engine/engine.cc:55: MXNet start using engine: NaiveEngine Shape (128, 128) 0.0008789 seconds for quantize 0.0008693 seconds for quantize_v2 0.175 seconds for intgemm intgemm is 49.7x faster Shape (256, 256) 0.0034812 seconds for quantize 0.0034044 seconds for quantize_v2 0.212 seconds for intgemm intgemm is 161.0x faster Shape (512, 512) 0.0138909 seconds for quantize 0.0138283 seconds for quantize_v2 0.731 seconds for intgemm intgemm is 189.3x faster Shape (1024, 1024) 0.0557616 seconds for quantize 0.0553598 seconds for quantize_v2 0.0002330 seconds for intgemm intgemm is 237.6x faster Shape (2048, 2048) 0.2225617 seconds for quantize 0.2196410 seconds for quantize_v2 0.0008387 seconds for intgemm intgemm is 261.9x faster Shape (8, 4096) 0.0017372 seconds for quantize 0.0017434 seconds for quantize_v2 0.183 seconds for intgemm intgemm is 94.8x faster ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587073135 Also, OMP performance in MXNet quantizer is very bad. (NB: intgemm is running single-threaded here, partly because OMP is bad at this problem) ```bash export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=2; taskset --cpu-list 0,1 ./quant_bench.py ``` ``` [16:18:40] src/engine/engine.cc:55: MXNet start using engine: NaiveEngine Shape (128, 128) 0.0008789 seconds for quantize 0.0008693 seconds for quantize_v2 0.175 seconds for intgemm intgemm is 49.7x faster Shape (256, 256) 0.0034812 seconds for quantize 0.0034044 seconds for quantize_v2 0.212 seconds for intgemm intgemm is 161.0x faster Shape (512, 512) 0.0138909 seconds for quantize 0.0138283 seconds for quantize_v2 0.731 seconds for intgemm intgemm is 189.3x faster Shape (1024, 1024) 0.0557616 seconds for quantize 0.0553598 seconds for quantize_v2 0.0002330 seconds for intgemm intgemm is 237.6x faster Shape (2048, 2048) 0.2225617 seconds for quantize 0.2196410 seconds for quantize_v2 0.0008387 seconds for intgemm intgemm is 261.9x faster Shape (8, 4096) 0.0017372 seconds for quantize 0.0017434 seconds for quantize_v2 0.183 seconds for intgemm intgemm is 94.8x faster ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham commented on issue #17513: Correct the grammar in 1-ndarray tutorial
aaronmarkham commented on issue #17513: Correct the grammar in 1-ndarray tutorial URL: https://github.com/apache/incubator-mxnet/pull/17513#issuecomment-587080976 > @aaronmarkham I am unsure why the approval does not pass on centos-gpu, could you please take a look at it or alternatively override the check? I restarted it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham commented on issue #17594: upgrade sphinx and autodocsumm
aaronmarkham commented on issue #17594: upgrade sphinx and autodocsumm URL: https://github.com/apache/incubator-mxnet/pull/17594#issuecomment-587082382 ![failure-to-launch](https://user-images.githubusercontent.com/5974205/74672901-0d998b00-5163-11ea-8de3-fc463b01a0c8.jpg) Windows GPU test at it again restarted... This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham commented on issue #11395: Flaky test: test_operator_gpu.test_sequence_last causes 'CUDA: unspecified launch failure'
aaronmarkham commented on issue #11395: Flaky test: test_operator_gpu.test_sequence_last causes 'CUDA: unspecified launch failure' URL: https://github.com/apache/incubator-mxnet/issues/11395#issuecomment-587085562 Again here and another I just restarted... http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17594/1/pipeline ![failure-to-launch](https://user-images.githubusercontent.com/5974205/74673380-eabba680-5163-11ea-82ff-59d3e7286533.jpg) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587066870 The current MXNet quantizer is 3-10x slower than intgemm's on a wide variety of matrix sizes. Experiment on c5.12xlarge: ``` Shape (128, 128) 0.731 seconds for quantize 0.706 seconds for quantize_v2 0.219 seconds for intgemm intgemm is 3.2x faster Shape (256, 256) 0.0002116 seconds for quantize 0.0001778 seconds for quantize_v2 0.258 seconds for intgemm intgemm is 6.9x faster Shape (512, 512) 0.0008112 seconds for quantize 0.0006480 seconds for quantize_v2 0.917 seconds for intgemm intgemm is 7.1x faster Shape (1024, 1024) 0.0030176 seconds for quantize 0.0023387 seconds for quantize_v2 0.0002542 seconds for intgemm intgemm is 9.2x faster Shape (2048, 2048) 0.0118271 seconds for quantize 0.0090704 seconds for quantize_v2 0.0008705 seconds for intgemm intgemm is 10.4x faster Shape (8, 4096) 0.0001187 seconds for quantize 0.0001061 seconds for quantize_v2 0.226 seconds for intgemm intgemm is 4.7x faster ``` Generated by `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=1; taskset --cpu-list 0 ./quant_bench.py` where `quant_bench.py` is: ```python #!/usr/bin/env python3 import mxnet as mx import time def time_procedure(shape, count, proc): data = mx.nd.random_uniform(shape=shape, low=-1.0, high = 1.0) mx.nd.waitall() begin = time.time() for i in range(0, count): proc(data) mx.nd.waitall() return (time.time() - begin) / count shapes = [(128, 128), (256,256), (512, 512), (1024, 1024), (2048, 2048)] count = 1000 one = mx.nd.ones(shape=(1)) minusone = -one procedures = { "quantize" : (lambda data : mx.nd.contrib.quantize(data, minusone, one)), "quantize_v2" : (lambda data : mx.nd.contrib.quantize_v2(data, min_calib_range = -1.0, max_calib_range = 1.0)), "intgemm" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, one)) } for s in shapes: print("Shape " + str(s)) stats = {} for name, l in procedures.items(): stats[name] = time_procedure(s, count, l) print("{:.7f} seconds for {}".format(stats[name], name)) best_baseline = min(stats["quantize"], stats["quantize_v2"]) ratio = best_baseline / stats["intgemm"] print("intgemm is {:.1f}x faster".format(ratio)) ``` As a C++ programmer used to benchmarking with `clock_gettime`, using Python to do benchmarks pains me, but I think the point is clear. If anything the Python overhead is pushing results towards 1 by adding to numerator and denominator. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] szha commented on issue #17331: [mxnet 2.0] [item 2.4] Turning on large tensor support by default
szha commented on issue #17331: [mxnet 2.0] [item 2.4] Turning on large tensor support by default URL: https://github.com/apache/incubator-mxnet/issues/17331#issuecomment-587090121 The slowdown for BERT (-22.98%) is quite significant. We will need to mitigate this before moving forward. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu merged pull request #17603: Backport #17596
leezu merged pull request #17603: Backport #17596 URL: https://github.com/apache/incubator-mxnet/pull/17603 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet] branch v1.6.x updated: Backport #17596 (#17603)
This is an automated email from the ASF dual-hosted git repository. lausen pushed a commit to branch v1.6.x in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git The following commit(s) were added to refs/heads/v1.6.x by this push: new 4da66fa Backport #17596 (#17603) 4da66fa is described below commit 4da66fa90988102d23c6702cc5a9b9d01346bbef Author: Leonard Lausen AuthorDate: Mon Feb 17 09:24:28 2020 -0800 Backport #17596 (#17603) * Fix transformer.cu interleaved matmul for cuda arch < 5 (#17596) cublasGemmBatchedEx is only supported for GPU with architecture capabilities equal or greater than 5.0. Fixes a bug in #16408 * pin Markdown version to 3.1 in Julia doc build (#17549) * pin Sphinx due to autodocsumm issue with v4.2.0 (#17561) * pin python dependencies (#17556) * [CI] Fix static build pipeline (#17474) * 1.5.x CI fixes (#17426) * Fix numpy decorator * Workaround https://github.com/pytest-dev/pytest/issues/5903 * Disable pylint warnings * Fix Edge build * Fix numpy decorator on Centos * Follow redirects when downloading apache-maven-3.3.9-bin.tar.gz Co-authored-by: Hao Jin Co-authored-by: Aaron Markham --- ci/docker/install/centos7_python.sh| 4 +- ci/docker/install/centos7_scala.sh | 4 +- ci/docker/install/requirements | 1 + ci/docker/install/ubuntu_onnx.sh | 4 +- ci/docker/install/ubuntu_publish.sh| 19 ci/docker/install/ubuntu_scala.sh | 4 +- docs/python_docs/environment.yml | 2 +- julia/docs/Makefile| 13 +- src/operator/contrib/transformer.cu| 71 +- tools/caffe_converter/caffe_proto_utils.py | 2 +- tools/caffe_converter/convert_mean.py | 2 +- 11 files changed, 91 insertions(+), 35 deletions(-) diff --git a/ci/docker/install/centos7_python.sh b/ci/docker/install/centos7_python.sh index 8521cde..686cf14 100755 --- a/ci/docker/install/centos7_python.sh +++ b/ci/docker/install/centos7_python.sh @@ -31,5 +31,5 @@ curl "https://bootstrap.pypa.io/get-pip.py"; -o "get-pip.py" python2.7 get-pip.py python3.6 get-pip.py -pip2 install nose pylint numpy nose-timer requests h5py scipy==1.0.1 -pip3 install nose pylint numpy nose-timer requests h5py scipy==1.0.1 +pip2 install nose pylint numpy nose-timer requests h5py scipy==1.2.1 decorator==4.4.0 +pip3 install nose pylint numpy nose-timer requests h5py scipy==1.2.1 decorator==4.4.0 diff --git a/ci/docker/install/centos7_scala.sh b/ci/docker/install/centos7_scala.sh index 5a1c416..df0d7a1 100755 --- a/ci/docker/install/centos7_scala.sh +++ b/ci/docker/install/centos7_scala.sh @@ -27,8 +27,8 @@ export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk export PATH=$JAVA_HOME/bin:$PATH # Build from source with Maven -curl -o apache-maven-3.3.9-bin.tar.gz http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ -|| curl -o apache-maven-3.3.9-bin.tar.gz https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz +curl -o apache-maven-3.3.9-bin.tar.gz -L http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ +|| curl -o apache-maven-3.3.9-bin.tar.gz -L https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz tar xzf apache-maven-3.3.9-bin.tar.gz mkdir /usr/local/maven diff --git a/ci/docker/install/requirements b/ci/docker/install/requirements index fd716f5..61c9ef8 100644 --- a/ci/docker/install/requirements +++ b/ci/docker/install/requirements @@ -21,6 +21,7 @@ boto3==1.9.229 cpplint==1.3.0 Cython==0.29.7 +CommonMark==0.5.4 decorator==4.4.0 h5py==2.8.0rc1 mock==2.0.0 diff --git a/ci/docker/install/ubuntu_onnx.sh b/ci/docker/install/ubuntu_onnx.sh index 3070289..1a220c7 100755 --- a/ci/docker/install/ubuntu_onnx.sh +++ b/ci/docker/install/ubuntu_onnx.sh @@ -31,5 +31,5 @@ apt-get update || true apt-get install -y libprotobuf-dev protobuf-compiler echo "Installing pytest, pytest-cov, protobuf, Pillow, ONNX and tabulate ..." -pip2 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 -pip3 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 +pip2 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 attrs==19.1.0 +pip3 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 attrs==19.1.0 diff --git a/ci/docker/install/ubuntu_publish.sh b/ci/docker/install/ubuntu_publish.sh index 65982ee..c3517e2 100755 --- a/ci/docker/install/ubuntu_publish.sh +++ b/ci/docker/install/ubuntu_publish.sh @@ -48,8 +48,8 @@ apt-get install -y git \ pkg-config \ open
[incubator-mxnet] branch v1.6.x updated: Backport #17596 (#17603)
This is an automated email from the ASF dual-hosted git repository. lausen pushed a commit to branch v1.6.x in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git The following commit(s) were added to refs/heads/v1.6.x by this push: new 4da66fa Backport #17596 (#17603) 4da66fa is described below commit 4da66fa90988102d23c6702cc5a9b9d01346bbef Author: Leonard Lausen AuthorDate: Mon Feb 17 09:24:28 2020 -0800 Backport #17596 (#17603) * Fix transformer.cu interleaved matmul for cuda arch < 5 (#17596) cublasGemmBatchedEx is only supported for GPU with architecture capabilities equal or greater than 5.0. Fixes a bug in #16408 * pin Markdown version to 3.1 in Julia doc build (#17549) * pin Sphinx due to autodocsumm issue with v4.2.0 (#17561) * pin python dependencies (#17556) * [CI] Fix static build pipeline (#17474) * 1.5.x CI fixes (#17426) * Fix numpy decorator * Workaround https://github.com/pytest-dev/pytest/issues/5903 * Disable pylint warnings * Fix Edge build * Fix numpy decorator on Centos * Follow redirects when downloading apache-maven-3.3.9-bin.tar.gz Co-authored-by: Hao Jin Co-authored-by: Aaron Markham --- ci/docker/install/centos7_python.sh| 4 +- ci/docker/install/centos7_scala.sh | 4 +- ci/docker/install/requirements | 1 + ci/docker/install/ubuntu_onnx.sh | 4 +- ci/docker/install/ubuntu_publish.sh| 19 ci/docker/install/ubuntu_scala.sh | 4 +- docs/python_docs/environment.yml | 2 +- julia/docs/Makefile| 13 +- src/operator/contrib/transformer.cu| 71 +- tools/caffe_converter/caffe_proto_utils.py | 2 +- tools/caffe_converter/convert_mean.py | 2 +- 11 files changed, 91 insertions(+), 35 deletions(-) diff --git a/ci/docker/install/centos7_python.sh b/ci/docker/install/centos7_python.sh index 8521cde..686cf14 100755 --- a/ci/docker/install/centos7_python.sh +++ b/ci/docker/install/centos7_python.sh @@ -31,5 +31,5 @@ curl "https://bootstrap.pypa.io/get-pip.py"; -o "get-pip.py" python2.7 get-pip.py python3.6 get-pip.py -pip2 install nose pylint numpy nose-timer requests h5py scipy==1.0.1 -pip3 install nose pylint numpy nose-timer requests h5py scipy==1.0.1 +pip2 install nose pylint numpy nose-timer requests h5py scipy==1.2.1 decorator==4.4.0 +pip3 install nose pylint numpy nose-timer requests h5py scipy==1.2.1 decorator==4.4.0 diff --git a/ci/docker/install/centos7_scala.sh b/ci/docker/install/centos7_scala.sh index 5a1c416..df0d7a1 100755 --- a/ci/docker/install/centos7_scala.sh +++ b/ci/docker/install/centos7_scala.sh @@ -27,8 +27,8 @@ export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk export PATH=$JAVA_HOME/bin:$PATH # Build from source with Maven -curl -o apache-maven-3.3.9-bin.tar.gz http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ -|| curl -o apache-maven-3.3.9-bin.tar.gz https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz +curl -o apache-maven-3.3.9-bin.tar.gz -L http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ +|| curl -o apache-maven-3.3.9-bin.tar.gz -L https://search.maven.org/remotecontent?filepath=org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.tar.gz tar xzf apache-maven-3.3.9-bin.tar.gz mkdir /usr/local/maven diff --git a/ci/docker/install/requirements b/ci/docker/install/requirements index fd716f5..61c9ef8 100644 --- a/ci/docker/install/requirements +++ b/ci/docker/install/requirements @@ -21,6 +21,7 @@ boto3==1.9.229 cpplint==1.3.0 Cython==0.29.7 +CommonMark==0.5.4 decorator==4.4.0 h5py==2.8.0rc1 mock==2.0.0 diff --git a/ci/docker/install/ubuntu_onnx.sh b/ci/docker/install/ubuntu_onnx.sh index 3070289..1a220c7 100755 --- a/ci/docker/install/ubuntu_onnx.sh +++ b/ci/docker/install/ubuntu_onnx.sh @@ -31,5 +31,5 @@ apt-get update || true apt-get install -y libprotobuf-dev protobuf-compiler echo "Installing pytest, pytest-cov, protobuf, Pillow, ONNX and tabulate ..." -pip2 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 -pip3 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 +pip2 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 attrs==19.1.0 +pip3 install pytest==3.6.3 pytest-cov==2.5.1 protobuf==3.5.2 onnx==1.3.0 Pillow==5.0.0 tabulate==0.7.5 attrs==19.1.0 diff --git a/ci/docker/install/ubuntu_publish.sh b/ci/docker/install/ubuntu_publish.sh index 65982ee..c3517e2 100755 --- a/ci/docker/install/ubuntu_publish.sh +++ b/ci/docker/install/ubuntu_publish.sh @@ -48,8 +48,8 @@ apt-get install -y git \ pkg-config \ open
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587066870 The current MXNet quantizer is much slower than intgemm's on a wide variety of matrix sizes. Experiment on c5.12xlarge: ``` Shape (128, 128) 0.864 seconds for quantize 0.0001020 seconds for quantize_v2 0.211 seconds for intgemm 0.0001145 seconds for quantize_v2_fit 0.409 seconds for intgemm_fit intgemm is 4.1x faster with calibration intgemm is 2.8x faster without calibration Shape (256, 256) 0.0001065 seconds for quantize 0.0001268 seconds for quantize_v2 0.259 seconds for intgemm 0.0002040 seconds for quantize_v2_fit 0.554 seconds for intgemm_fit intgemm is 4.1x faster with calibration intgemm is 3.7x faster without calibration Shape (512, 512) 0.0001961 seconds for quantize 0.0002111 seconds for quantize_v2 0.864 seconds for intgemm 0.0005762 seconds for quantize_v2_fit 0.0001862 seconds for intgemm_fit intgemm is 2.3x faster with calibration intgemm is 3.1x faster without calibration Shape (1024, 1024) 0.0003830 seconds for quantize 0.0003858 seconds for quantize_v2 0.0002519 seconds for intgemm 0.0019079 seconds for quantize_v2_fit 0.0005164 seconds for intgemm_fit intgemm is 1.5x faster with calibration intgemm is 3.7x faster without calibration Shape (2048, 2048) 0.0011643 seconds for quantize 0.0011415 seconds for quantize_v2 0.0008675 seconds for intgemm 0.0072411 seconds for quantize_v2_fit 0.0017965 seconds for intgemm_fit intgemm is 1.3x faster with calibration intgemm is 4.0x faster without calibration Shape (8, 4096) 0.920 seconds for quantize 0.0001098 seconds for quantize_v2 0.222 seconds for intgemm 0.0001424 seconds for quantize_v2_fit 0.452 seconds for intgemm_fit intgemm is 4.1x faster with calibration intgemm is 3.1x faster without calibration Shape (4096, 8) 0.921 seconds for quantize 0.0001091 seconds for quantize_v2 0.220 seconds for intgemm 0.0001409 seconds for quantize_v2_fit 0.456 seconds for intgemm_fit intgemm is 4.2x faster with calibration intgemm is 3.1x faster without calibration ``` Generated by `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=1; taskset --cpu-list 0 ./quant_bench.py` where `quant_bench.py` is: ```python #!/usr/bin/env python3 import mxnet as mx import time def time_procedure(shape, count, proc): data = mx.nd.random_uniform(shape=shape, low=-1.0, high = 1.0) mx.nd.waitall() begin = time.time() for i in range(0, count): proc(data) mx.nd.waitall() return (time.time() - begin) / count shapes = [(128, 128), (256,256), (512, 512), (1024, 1024), (2048, 2048), (8, 4096), (4096, 8)] count = 1000 one = mx.nd.ones(shape=(1)) minusone = -one procedures = { "quantize" : (lambda data : mx.nd.contrib.quantize(data, minusone, one)), "quantize_v2" : (lambda data : mx.nd.contrib.quantize_v2(data, min_calib_range = -1.0, max_calib_range = 1.0)), "intgemm" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, one)), "quantize_v2_fit" : (lambda data : mx.nd.contrib.quantize_v2(data)), "intgemm_fit" : (lambda data : mx.nd.contrib.intgemm_prepare_data(data, mx.nd.contrib.intgemm_maxabsolute(data))), } for s in shapes: print("Shape " + str(s)) stats = {} for name, l in procedures.items(): stats[name] = time_procedure(s, count, l) print("{:.7f} seconds for {}".format(stats[name], name)) best_baseline = min(stats["quantize"], stats["quantize_v2"]) ratio = best_baseline / stats["intgemm"] print("intgemm is {:.1f}x faster with calibration".format(ratio)) fit_ratio = stats["quantize_v2_fit"] / stats["intgemm_fit"] print("intgemm is {:.1f}x faster without calibration".format(fit_ratio)) ``` As a C++ programmer used to benchmarking with `clock_gettime`, using Python to do benchmarks pains me, but I think the point is clear. If anything the Python overhead is pushing results towards 1 by adding to numerator and denominator. (If you're wondering what changed from previous results, I upgraded to gcc 8). This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
kpuatamazon edited a comment on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587073135 Also, OMP scaling in MXNet quantizer is not great. (Baseline here is intgemm running single) `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=2; taskset --cpu-list 0,1 ./quant_bench.py` ``` Shape (128, 128) 0.925 seconds for quantize 0.0001086 seconds for quantize_v2 0.181 seconds for intgemm 0.0001093 seconds for quantize_v2_fit 0.357 seconds for intgemm_fit intgemm is 5.1x faster with calibration intgemm is 3.1x faster without calibration Shape (256, 256) 0.0001007 seconds for quantize 0.0001192 seconds for quantize_v2 0.222 seconds for intgemm 0.0001536 seconds for quantize_v2_fit 0.497 seconds for intgemm_fit intgemm is 4.5x faster with calibration intgemm is 3.1x faster without calibration Shape (512, 512) 0.0001490 seconds for quantize 0.0001629 seconds for quantize_v2 0.769 seconds for intgemm 0.0003444 seconds for quantize_v2_fit 0.0001610 seconds for intgemm_fit intgemm is 1.9x faster with calibration intgemm is 2.1x faster without calibration Shape (1024, 1024) 0.0002579 seconds for quantize 0.0002620 seconds for quantize_v2 0.0002375 seconds for intgemm 0.0010501 seconds for quantize_v2_fit 0.0004887 seconds for intgemm_fit intgemm is 1.1x faster with calibration intgemm is 2.1x faster without calibration Shape (2048, 2048) 0.0006628 seconds for quantize 0.0006300 seconds for quantize_v2 0.0008444 seconds for intgemm 0.0037701 seconds for quantize_v2_fit 0.0017605 seconds for intgemm_fit intgemm is 0.7x faster with calibration intgemm is 2.1x faster without calibration Shape (8, 4096) 0.963 seconds for quantize 0.0001119 seconds for quantize_v2 0.188 seconds for intgemm 0.0001231 seconds for quantize_v2_fit 0.404 seconds for intgemm_fit intgemm is 5.1x faster with calibration intgemm is 3.0x faster without calibration Shape (4096, 8) 0.955 seconds for quantize 0.0001110 seconds for quantize_v2 0.191 seconds for intgemm 0.0001237 seconds for quantize_v2_fit 0.403 seconds for intgemm_fit intgemm is 5.0x faster with calibration intgemm is 3.1x faster without calibration ``` `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=48; ./quant_bench.py` ``` Shape (128, 128) 0.0002489 seconds for quantize 0.0002599 seconds for quantize_v2 0.313 seconds for intgemm 0.0002602 seconds for quantize_v2_fit 0.610 seconds for intgemm_fit intgemm is 7.9x faster with calibration intgemm is 4.3x faster without calibration Shape (256, 256) 0.0002440 seconds for quantize 0.0002617 seconds for quantize_v2 0.374 seconds for intgemm 0.0002714 seconds for quantize_v2_fit 0.813 seconds for intgemm_fit intgemm is 6.5x faster with calibration intgemm is 3.3x faster without calibration Shape (512, 512) 0.0002484 seconds for quantize 0.0002652 seconds for quantize_v2 0.0001080 seconds for intgemm 0.0002987 seconds for quantize_v2_fit 0.0002220 seconds for intgemm_fit intgemm is 2.3x faster with calibration intgemm is 1.3x faster without calibration Shape (1024, 1024) 0.0002648 seconds for quantize 0.0002833 seconds for quantize_v2 0.0002505 seconds for intgemm 0.0003843 seconds for quantize_v2_fit 0.0005266 seconds for intgemm_fit intgemm is 1.1x faster with calibration intgemm is 0.7x faster without calibration Shape (2048, 2048) 0.0003306 seconds for quantize 0.0003467 seconds for quantize_v2 0.0007946 seconds for intgemm 0.0006679 seconds for quantize_v2_fit 0.0017266 seconds for intgemm_fit intgemm is 0.4x faster with calibration intgemm is 0.4x faster without calibration Shape (8, 4096) 0.0002452 seconds for quantize 0.0002593 seconds for quantize_v2 0.331 seconds for intgemm 0.0002629 seconds for quantize_v2_fit 0.678 seconds for intgemm_fit intgemm is 7.4x faster with calibration intgemm is 3.9x faster without calibration Shape (4096, 8) 0.0002426 seconds for quantize 0.0002600 seconds for quantize_v2 0.328 seconds for intgemm 0.0002641 seconds for quantize_v2_fit 0.678 seconds for intgemm_fit intgemm is 7.4x faster with calibration intgemm is 3.9x faster without calibration ``` `export MXNET_ENGINE_TYPE=NaiveEngine; export OMP_NUM_THREADS=24; ./quant_bench.py` ``` Shape (128, 128) 0.0001447 seconds for quantize 0.0001602 seconds for quantize_v2 0.227 seconds for intgemm 0.0001592 seconds for quantize_v2_fit 0.458 seconds for intgemm_fit intgemm is 6.4x faster with calibration intgemm is 3.5x faster without calibration Shape (256, 25
[GitHub] [incubator-mxnet] tlby commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support.
tlby commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support. URL: https://github.com/apache/incubator-mxnet/pull/17610#discussion_r380310923 ## File path: perl-package/AI-MXNet/lib/AI/MXNet/NDArray.pm ## @@ -384,8 +385,11 @@ method _slice ( ) { confess("start $start > stop $stop") if $start > $stop; +my $sub = AI::MXNet::RunTime->Features()->is_enabled('INT64_TENSOR_SIZE') + ? \&AI::MXNetCAPI::NDArraySlice64 + : \&AI::MXNetCAPI::NDArraySlice; Review comment: It seems a little awkward to put the caller in charge of checking the `INT64_TENSOR_SIZE` compile setting. Would it make sense to make `AI::MXNetCAPI::NDArraySlice()` and friends responsible for checking the flag and deferring to the `NDArray*64()` variants when appropriate? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err
ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err URL: https://github.com/apache/incubator-mxnet/pull/17597#issuecomment-587110492 My point about security was a general point. I just made a note of it here. This was function 'printStackTrace' was already present since #17065 I have only made 1 change (move that logging from std err to std out) - so that it gets print in the console. Not sure what security consideration should I consider? This change of mine doesn't need any change in the existing Script Security (since it has already added printStackTrace to the approved function list) It can be verified here - http://jenkins.mxnet-ci.amazon-ml.com/scriptApproval/ ![Screen Shot 2020-02-17 at 10 18 59 AM](https://user-images.githubusercontent.com/10992635/74678135-f3fe4080-516e-11ea-9c8c-3b4851fbfef8.png) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu commented on issue #17592: Add cmake build support for macOS static build.
leezu commented on issue #17592: Add cmake build support for macOS static build. URL: https://github.com/apache/incubator-mxnet/pull/17592#issuecomment-587112744 Thank you @frankfliu ! Should now be fixed by https://github.com/apache/incubator-mxnet/pull/17602 ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu closed pull request #17592: Add cmake build support for macOS static build.
leezu closed pull request #17592: Add cmake build support for macOS static build. URL: https://github.com/apache/incubator-mxnet/pull/17592 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham merged pull request #17513: Correct the grammar in 1-ndarray tutorial
aaronmarkham merged pull request #17513: Correct the grammar in 1-ndarray tutorial URL: https://github.com/apache/incubator-mxnet/pull/17513 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet] branch master updated (c4c639d -> 8525926)
This is an automated email from the ASF dual-hosted git repository. aaronmarkham pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git. from c4c639d support np.dsplit, fix some error msgs and corner cases for hsplit and vsplit, add interoperability tests for h/v/dsplit (#17478) add 8525926 Correct the grammar in 1-ndarray tutorial (#17513) No new revisions were added by this update. Summary of changes: .../tutorials/getting-started/crash-course/1-ndarray.md | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)
[GitHub] [incubator-mxnet] sergeykolychev commented on issue #17610: MXNET-1447 [Perl] Runtime features and large tensor support.
sergeykolychev commented on issue #17610: MXNET-1447 [Perl] Runtime features and large tensor support. URL: https://github.com/apache/incubator-mxnet/pull/17610#issuecomment-587115463 @tlby The ``mx_`` typedefs change is a sync to current state of the mxnet/c_api.h in master branch. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] sergeykolychev commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support.
sergeykolychev commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support. URL: https://github.com/apache/incubator-mxnet/pull/17610#discussion_r380326059 ## File path: perl-package/AI-MXNet/lib/AI/MXNet/NDArray.pm ## @@ -384,8 +385,11 @@ method _slice ( ) { confess("start $start > stop $stop") if $start > $stop; +my $sub = AI::MXNet::RunTime->Features()->is_enabled('INT64_TENSOR_SIZE') + ? \&AI::MXNetCAPI::NDArraySlice64 + : \&AI::MXNetCAPI::NDArraySlice; Review comment: @tlby On python side the switch is made in the caller space. The c api has two functions defined for each task, one with ```(u)?int32_t``` input/output and another with `(u)?int64_t` I don't know how to combine these two functions via the swig space. Looks like a task for you to complete later the line. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] roywei commented on issue #17547: Fix cudnn Dropout reproducibility
roywei commented on issue #17547: Fix cudnn Dropout reproducibility URL: https://github.com/apache/incubator-mxnet/pull/17547#issuecomment-587118629 @DickJC123 @ptrendx could you help take a look again? Thanks This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] marcoabreu commented on issue #17597: [CI] Move stacktrace print to console rather than system.err
marcoabreu commented on issue #17597: [CI] Move stacktrace print to console rather than system.err URL: https://github.com/apache/incubator-mxnet/pull/17597#issuecomment-587119287 The question is which security considerations have been put in place when the function was whitelisted This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380329639 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,41 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + // Context of data. + // MXContext ctx; +}; + /*! * \brief Tensor data structure used by custom operator */ struct MXTensor { - MXTensor() : data_ptr(NULL), dtype(kUNSET), verID(0) {} + MXTensor() : data_ptr(nullptr), dtype(kUNSET), verID(0), stype(kDefaultStorage) {} + // Construtor for dense. MXTensor(void *data_ptr, const std::vector &shape, MXDType dtype, - size_t vID, MXContext mx_ctx) - : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx) {} + size_t vID, MXContext mx_ctx, MXStorageType stype) + : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx), stype(stype) {} /*! \brief populate internal tensor fields */ + // To do: solve for CSR and row sparse. Review comment: Not yet, stilling working on it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet-site] branch asf-site updated: Bump the publish timestamp.
This is an automated email from the ASF dual-hosted git repository. aaronmarkham pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git The following commit(s) were added to refs/heads/asf-site by this push: new 21bb427 Bump the publish timestamp. 21bb427 is described below commit 21bb4277bc44316d29c4a1d743732af200543e15 Author: mxnet-ci AuthorDate: Mon Feb 17 18:56:05 2020 + Bump the publish timestamp. --- date.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/date.txt b/date.txt new file mode 100644 index 000..cab3da4 --- /dev/null +++ b/date.txt @@ -0,0 +1 @@ +Mon Feb 17 18:56:05 UTC 2020
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380329639 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,41 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + // Context of data. + // MXContext ctx; +}; + /*! * \brief Tensor data structure used by custom operator */ struct MXTensor { - MXTensor() : data_ptr(NULL), dtype(kUNSET), verID(0) {} + MXTensor() : data_ptr(nullptr), dtype(kUNSET), verID(0), stype(kDefaultStorage) {} + // Construtor for dense. MXTensor(void *data_ptr, const std::vector &shape, MXDType dtype, - size_t vID, MXContext mx_ctx) - : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx) {} + size_t vID, MXContext mx_ctx, MXStorageType stype) + : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx), stype(stype) {} /*! \brief populate internal tensor fields */ + // To do: solve for CSR and row sparse. Review comment: Not yet, stilling working on it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu commented on issue #8703: [DISCUSSION] python2 deprecation
leezu commented on issue #8703: [DISCUSSION] python2 deprecation URL: https://github.com/apache/incubator-mxnet/issues/8703#issuecomment-587121779 MXNet 1.6.x is the last release to support Python 2. See https://github.com/apache/incubator-mxnet/pull/15990 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu closed issue #8703: [DISCUSSION] python2 deprecation
leezu closed issue #8703: [DISCUSSION] python2 deprecation URL: https://github.com/apache/incubator-mxnet/issues/8703 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] leezu commented on issue #8703: [DISCUSSION] python2 deprecation
leezu commented on issue #8703: [DISCUSSION] python2 deprecation URL: https://github.com/apache/incubator-mxnet/issues/8703#issuecomment-587121948 Consensus in https://lists.apache.org/thread.html/r3a2db0f22a1680cc56804191446fef2289595798ca19fd17de1ff03e%40%3Cdev.mxnet.apache.org%3E This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] connorgoggins commented on a change in pull request #17599: Fixed Embedding op for LT input
connorgoggins commented on a change in pull request #17599: Fixed Embedding op for LT input URL: https://github.com/apache/incubator-mxnet/pull/17599#discussion_r380334678 ## File path: src/operator/tensor/indexing_op.h ## @@ -66,7 +66,7 @@ enum QuantizedEmbeddingOpResource {kTempSpace}; struct SparseEmbeddingParam: public dmlc::Parameter { - int input_dim; + index_t input_dim; int output_dim; Review comment: @apeforest excellent point, there would be. For example, the following call throws an error: ``` >>> mx.nd.Embedding(data=mx.nd.random_normal(shape=(1,)), weight=mx.nd.random_normal(shape=(1,2**32)), input_dim=1, output_dim=2**32) mxnet.base.MXNetError: MXNetError: Invalid Parameter format for output_dim expect int but value='4294967296', in operator Embedding(name="", output_dim="4294967296", input_dim="1") ``` With my latest update (changing the dtype of `output_dim` to `index_t`), here is the result: ``` >>> mx.nd.Embedding(data=mx.nd.random_normal(shape=(1,)), weight=mx.nd.random_normal(shape=(1,2**32)), input_dim=1, output_dim=2**32) [[ 1.6323917 -0.33354783 -1.7378405 ... -0.36648417 0.6363522 2.367109 ]] ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err
ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err URL: https://github.com/apache/incubator-mxnet/pull/17597#issuecomment-587125716 Um it's a common practice to get the stack trace of errors and render them on Jenkins. A cursory glance on google search revealed lots of users doing that. I'm not sure if printing stacktrace poses security risk. Can you be more specific? Unable to understand exactly what's the contention. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] marcoabreu commented on issue #17597: [CI] Move stacktrace print to console rather than system.err
marcoabreu commented on issue #17597: [CI] Move stacktrace print to console rather than system.err URL: https://github.com/apache/incubator-mxnet/pull/17597#issuecomment-587127491 Generally it's discouraged security wise to expose the stack trace of a system to the public since it offers insight into a protected system. Exceptions are generally logged into a system log which is only accessible to administrators. This is also the case for Jenkins. Printing the stack trace of the Jenkins master to public though is not something that's recommended. Printing the stack trace within docker is fine, within Jenkins though it's not. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] eric-haibin-lin edited a comment on issue #17109: [mxnet 2.0][item 3.2] Unify Executor
eric-haibin-lin edited a comment on issue #17109: [mxnet 2.0][item 3.2] Unify Executor URL: https://github.com/apache/incubator-mxnet/issues/17109#issuecomment-567170801 Features of the symbolic executor 1. memory planning 2. Infer shape, dtype, storage type 3. gradient checkpointing (aka mirror) 4. Subgraph support 5. Control flow support 6. Dynamic shape op support 7. Python/C predict API 8. Graph passes for fusion/quantization 9. cross-device context group support Features missing/requires validation for Gluon imperative - gradient checkpointing - C predict API - Graph passes for fusion/quantization - whether performance is on par with symbolic executor - cross-device context group support This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380387317 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,41 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + // Context of data. + // MXContext ctx; +}; + /*! * \brief Tensor data structure used by custom operator */ struct MXTensor { - MXTensor() : data_ptr(NULL), dtype(kUNSET), verID(0) {} + MXTensor() : data_ptr(nullptr), dtype(kUNSET), verID(0), stype(kDefaultStorage) {} + // Construtor for dense. MXTensor(void *data_ptr, const std::vector &shape, MXDType dtype, - size_t vID, MXContext mx_ctx) - : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx) {} + size_t vID, MXContext mx_ctx, MXStorageType stype) + : data_ptr(data_ptr), shape(shape), dtype(dtype), verID(vID), ctx(mx_ctx), stype(stype) {} /*! \brief populate internal tensor fields */ + // To do: solve for CSR and row sparse. Review comment: Done in the latest commits. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380387421 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,41 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + // Context of data. + // MXContext ctx; Review comment: Removed. Thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] zachgk merged pull request #17434: Fix get_started scala gpu
zachgk merged pull request #17434: Fix get_started scala gpu URL: https://github.com/apache/incubator-mxnet/pull/17434 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet] branch master updated (8525926 -> 0f3c5da)
This is an automated email from the ASF dual-hosted git repository. zachgk pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git. from 8525926 Correct the grammar in 1-ndarray tutorial (#17513) add 0f3c5da Fix get_started scala gpu (#17434) No new revisions were added by this update. Summary of changes: docs/static_site/src/_includes/get_started/linux/scala/gpu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[GitHub] [incubator-mxnet] szhengac opened a new issue #17616: CUDA: unspecified launch failure on CI Windows
szhengac opened a new issue #17616: CUDA: unspecified launch failure on CI Windows URL: https://github.com/apache/incubator-mxnet/issues/17616 ## Description CI on windows keeps giving `CUDA: unspecified launch failure`. It has been retriggered many times. http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17400/20/pipeline/ This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] connorgoggins opened a new pull request #17617: [LT] Fixed Spatial Transformer op
connorgoggins opened a new pull request #17617: [LT] Fixed Spatial Transformer op URL: https://github.com/apache/incubator-mxnet/pull/17617 ## Description ## The Spatial Transformer op was previously breaking on large tensor (dimension >= 2^32) data. With the following input: ``` run_performance_test(nd.SpatialTransformer, run_backward=True, inputs=[{'data': (2, 2**29,1,6), 'loc': nd.random_normal(shape=(2,6)), 'transform_type': 'affine', 'sampler_type': 'bilinear', 'target_shape': (2,6)}], warmup=1, runs=1) ``` the following error was thrown: ``` *** Error in `python3': double free or corruption (out): 0x7f36bbffe010 *** ``` To root cause this issue, I ran the previous command in a Python script with GDB, and found that the underlying problem was in the iteration portion of the forward and backward methods of `spatial_transformer.cc`. Several of the variables used in the iteration used the `int` dtype when they should have been using `index_t` to properly handle long int indices. I switched these variables to `index_t` in the forward and backward methods, and after rebuilding, the previous input command displayed the correct output: ``` INFO:root:Begin Benchmark - SpatialTransformer INFO:root:Complete Benchmark - SpatialTransformer [{'SpatialTransformer': [{'inputs': {'data': (2, 536870912, 1, 6), 'loc': '', 'transform_type': 'affine', 'sampler_type': 'bilinear', 't arget_shape': (2, 6)}, 'max_storage_mem_alloc_cpu/0': 102005472.0, 'avg_time_forward_SpatialTransformer': 551614.125, 'avg_time_backward_SpatialTransformer': 511034.0938}]}] ``` ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [x] Changes are complete (i.e. I finished coding on this PR) - [x] All changes have test coverage - [x] Code is well-documented - [x] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - M src/operator/tensor/spatial_transformer.cc ## Comments ## Tested on r5dn.24xl-ubuntu 16.04 and p2.16xl-ubuntu 16.04 with 1. Individual op run 2. Full OpPerf run ## Results ## The key difference between CPU and GPU tests was the instance type (r5dn.24xl for CPU, p2.16xl for GPU). All relevant build flags remain the same, and both were tested using CPU context. [Single operator test - Embedding op (GPU)](https://gist.github.com/connorgoggins/7b3765e4e6f54f7841fb14e0930221ca) [Single operator test - Embedding op (CPU)](https://gist.github.com/connorgoggins/d97d64e73702a342bdeb170d30aef04f) [Full OpPerf test (GPU)](https://gist.github.com/connorgoggins/8b0563eaf98119980a5d36b7c61d796e) [Full OpPerf test (CPU)](https://gist.github.com/connorgoggins/4bebae70a85f7d9f754124187f52f383) @apeforest @access2rohit @ChaiBapchya This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] connorgoggins commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op
connorgoggins commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op URL: https://github.com/apache/incubator-mxnet/pull/17617#issuecomment-587196532 @mxnet-label-bot add [pr-awaiting-review] This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] szha commented on issue #17537: Outdated mxnet nightly build wheel instructions
szha commented on issue #17537: Outdated mxnet nightly build wheel instructions URL: https://github.com/apache/incubator-mxnet/issues/17537#issuecomment-587207363 The directory listing files are now available. I updated the https://repo.mxnet.io/dist/index.html with the links. It's now possible to install nightly builds with the same command: `pip install --pre mxnet -f https://dist.mxnet.io/python/cpu` Let's update the installation instructions to use the directory listing files. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] access2rohit commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op
access2rohit commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op URL: https://github.com/apache/incubator-mxnet/pull/17617#issuecomment-587208573 @connorgoggins can you tell me what are the possible types for DType here: https://github.com/apache/incubator-mxnet/pull/17617/files#diff-64979618e95b2211ff9317b0830fbbd2R37 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380404221 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,48 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + void set(void *Data, const int64_t* Dims, int NDims, void *Indices, + int64_t IndicesLen, void *IndPtr = nullptr, int64_t IndPtrLen = 0) { Review comment: can we use lowercase here? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380404221 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,48 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + void set(void *Data, const int64_t* Dims, int NDims, void *Indices, + int64_t IndicesLen, void *IndPtr = nullptr, int64_t IndPtrLen = 0) { Review comment: can we use lowercase here? like: ``` void *data_ptr void *idx int64_t num_idx void* idx_ptr int64_t num_idx_ptr This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380405292 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: Can we move this into setTensor? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380405292 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: Can we move this into setTensor? Especially since we have the same code down below for outputs This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380405292 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: Can we move this into setTensor? Especially since we have the same code down below for outputs, stateful, etc. too. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380405556 ## File path: src/c_api/c_api.cc ## @@ -114,13 +114,19 @@ void CustomFComputeDispatcher(const std::string op_name, const std::vector& req, const std::vector& outputs) { std::vector in_data, out_data; - std::vector in_shapes, out_shapes; + std::vector in_shapes, out_shapes; std::vector in_dims, out_dims; std::vector in_types, out_types; std::vector in_verIDs, out_verIDs; std::vector in_dev_type, out_dev_type; std::vector in_dev_id, out_dev_id; + // Aux data for sparse representation. Review comment: lets not use the word "aux" here since we're not talking about auxiliary params. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] tlby commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support.
tlby commented on a change in pull request #17610: MXNET-1447 [Perl] Runtime features and large tensor support. URL: https://github.com/apache/incubator-mxnet/pull/17610#discussion_r380406036 ## File path: perl-package/AI-MXNet/lib/AI/MXNet/NDArray.pm ## @@ -384,8 +385,11 @@ method _slice ( ) { confess("start $start > stop $stop") if $start > $stop; +my $sub = AI::MXNet::RunTime->Features()->is_enabled('INT64_TENSOR_SIZE') + ? \&AI::MXNetCAPI::NDArraySlice64 + : \&AI::MXNetCAPI::NDArraySlice; Review comment: If that's how things are done in Python, then no need to diverge from this pattern. Thanks! This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham commented on issue #17594: upgrade sphinx and autodocsumm
aaronmarkham commented on issue #17594: upgrade sphinx and autodocsumm URL: https://github.com/apache/incubator-mxnet/pull/17594#issuecomment-587218090 Windows gpu test failed to launch again This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380408788 ## File path: src/c_api/c_api.cc ## @@ -114,13 +114,19 @@ void CustomFComputeDispatcher(const std::string op_name, const std::vector& req, const std::vector& outputs) { std::vector in_data, out_data; - std::vector in_shapes, out_shapes; + std::vector in_shapes, out_shapes; std::vector in_dims, out_dims; std::vector in_types, out_types; std::vector in_verIDs, out_verIDs; std::vector in_dev_type, out_dev_type; std::vector in_dev_id, out_dev_id; + // Aux data for sparse representation. Review comment: Will update. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] aaronmarkham commented on issue #11395: Flaky test: test_operator_gpu.test_sequence_last causes 'CUDA: unspecified launch failure'
aaronmarkham commented on issue #11395: Flaky test: test_operator_gpu.test_sequence_last causes 'CUDA: unspecified launch failure' URL: https://github.com/apache/incubator-mxnet/issues/11395#issuecomment-587219725 Again: http://jenkins.mxnet-ci.amazon-ml.com/blue/organizations/jenkins/mxnet-validation%2Fwindows-gpu/detail/PR-17594/3/pipeline This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet-site] branch asf-site updated: Bump the publish timestamp.
This is an automated email from the ASF dual-hosted git repository. aaronmarkham pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git The following commit(s) were added to refs/heads/asf-site by this push: new d43ea5e Bump the publish timestamp. d43ea5e is described below commit d43ea5ef5c5aea95f00fc13c827d0b2d89fd09f7 Author: mxnet-ci AuthorDate: Tue Feb 18 00:43:06 2020 + Bump the publish timestamp. --- date.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/date.txt b/date.txt new file mode 100644 index 000..23c1724 --- /dev/null +++ b/date.txt @@ -0,0 +1 @@ +Tue Feb 18 00:43:06 UTC 2020
[GitHub] [incubator-mxnet] connorgoggins commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op
connorgoggins commented on issue #17617: [Large Tensor] Fixed Spatial Transformer op URL: https://github.com/apache/incubator-mxnet/pull/17617#issuecomment-587223138 @access2rohit DType here represents the type of the interior elements of the input tensors, and since SpatialTransformer only supports floating point types then DType could be `float32` or `float64` (also potentially `float16`, but this DType doesn't seem to have been implemented for GEMM on CPU yet). This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380409388 ## File path: include/mxnet/lib_api.h ## @@ -229,20 +241,48 @@ enum MXReturnValue { MX_SUCCESS = 1, }; +struct MXSparse { + // Pointer to data. + void *data{nullptr}; + // length of (non-zero) data. + int64_t data_len; + + // To store aux data for sparse. + // For CSR, indices stores the col index of non-zero values. + // For row sparse, indices store row index of rows which have non-zero values. + std::vector indices; + + // For CSR, indptr gives the start and end index of data for each row. + // For row sparse, indptr is empty. + std::vector indptr; + + void set(void *Data, const int64_t* Dims, int NDims, void *Indices, + int64_t IndicesLen, void *IndPtr = nullptr, int64_t IndPtrLen = 0) { Review comment: Agree. Will update later. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380410282 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: I could create a function for this part and therefore there will be no duplicate code. The advantage of this implementation is that we do not need to modify setTensor(). If we move it to setTensor(), we have to modify the interface to pass in all the extra data required by sparse. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
samskalicky commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380412726 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: or we could add a `setSparse` function that does this. So then we'll call both `setTensor` and `setSparse` for sparse arrays, but only `setTensor` for dense arrays. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators
guanxinq commented on a change in pull request #17569: [WIP] Adding sparse support to MXTensor for custom operators URL: https://github.com/apache/incubator-mxnet/pull/17569#discussion_r380414399 ## File path: include/mxnet/lib_api.h ## @@ -,16 +1166,63 @@ extern "C" { // create a vector of tensors for inputs std::vector inputs(num_in); + for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], - inIDs[i], {indev_type[i], indev_id[i]}); + MXStorageType type; + void *data = nullptr; + MXSparse sparse; + // Dense representation. + if(in_indices_shapes[i] == 0) { +type = kDefaultStorage; + data = indata[i]; + } + // Sparse representation. + else { +// To do: remove if else. + if(in_indptr_shapes[i] == 0) { + type = kRowSparseStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], in_indices_shapes[i]); +} +else { + type = kCSRStorage; + sparse.set(indata[i], inshapes[i], indims[i], in_indices[i], + in_indices_shapes[i], in_indptr[i], in_indptr_shapes[i]); +} + data = (void*)(&sparse); + } Review comment: Sounds better and I am planning to do it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] ciyongch commented on a change in pull request #17318: Enable MKL-DNN FullyConnected backward
ciyongch commented on a change in pull request #17318: Enable MKL-DNN FullyConnected backward URL: https://github.com/apache/incubator-mxnet/pull/17318#discussion_r380416282 ## File path: tests/cpp/include/test_mkldnn.h ## @@ -63,24 +63,24 @@ struct TestArrayShapes { }; // Init arrays with the default layout. -inline static void InitDefaultArray(NDArray *arr, bool is_rand = false) { +inline static void InitDefaultArray(NDArray *arr, bool is_rand = false, int max = 50) { const TBlob &blob = arr->data(); mshadow::default_real_t *data = blob.dptr(); int size = blob.Size(); for (int i = 0; i < size; i++) if (is_rand) { - data[i] = (std::rand() % 100) - 50; + data[i] = (std::rand() % (max * 2)) - max; Review comment: Ok, let's keep it as is for now. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err
ChaiBapchya commented on issue #17597: [CI] Move stacktrace print to console rather than system.err URL: https://github.com/apache/incubator-mxnet/pull/17597#issuecomment-587244013 @marcoabreu The security concerns are well-founded. @access2rohit Do you mind explaining here why it was chosen to add printStackTrace to console despite its security concerns? Is it coz a. Code for CI as well as MXNet codebase in general is open-source & public b. Errors revealed in stacktrace don't quite give away much info about the protected system. Did I miss something? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] pengzhao-intel commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
pengzhao-intel commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587247100 Thanks for the performance data and script. @ElaineBao could you take a try on both pre-VNNI and VNNI machine? cc @ZhennanQin This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] gachiemchiep commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC
gachiemchiep commented on issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC URL: https://github.com/apache/incubator-mxnet/issues/17613#issuecomment-587250039 Hi @TaoLv , @leezu Thank you for your support. Re-compiling mxnet on the NUC fix my problem This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] gachiemchiep closed issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC
gachiemchiep closed issue #17613: Illegal instruction (core dumped) when running mxnet on Intel NUC URL: https://github.com/apache/incubator-mxnet/issues/17613 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] ciyongch commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers
ciyongch commented on issue #17559: [MXNET-1446] Quantization: intgemm matrix multiply wrappers URL: https://github.com/apache/incubator-mxnet/pull/17559#issuecomment-587266270 @kpuatamazon Does this new wrappers work in the same way as current MXNet quantization flow? Do you have any simple case to show the typical usage of it? The current performance number sounds a good achievement with the given shape, can you share the status and plan to the shapes which are not 64 or multiple of 8? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] xidulu opened a new pull request #17618: Rewrite sample_n
xidulu opened a new pull request #17618: Rewrite sample_n URL: https://github.com/apache/incubator-mxnet/pull/17618 ## Description ## With this PR, sample_n could now be performed by letting the size parameter start with `-2`. ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes) - [ ] Changes are complete (i.e. I finished coding on this PR) - [ ] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [ ] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - [ ] Feature1, tests, (and when applicable, API doc) - [ ] Feature2, tests, (and when applicable, API doc) ## Comments ## - If this change is a backward incompatible change, why must this change be made. - Interesting edge cases to note here This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #17328: [numpy] add op pad
haojin2 commented on a change in pull request #17328: [numpy] add op pad URL: https://github.com/apache/incubator-mxnet/pull/17328#discussion_r380465021 ## File path: tests/python/unittest/test_numpy_op.py ## @@ -6787,6 +6787,63 @@ def hybrid_forward(self,F,a): assert_almost_equal(mx_out.asnumpy(), np_out, rtol=rtol, atol=atol) +@with_seed() +@use_np +def test_np_pad(): +class TestPad(HybridBlock): +def __init__(self, pad_width, mode='constant'): +super(TestPad,self).__init__() +self._pad_width = pad_width +self._mode = mode +def hybrid_forward(self,F,A,**kwargs): +return F.np.pad(A, self._pad_width, mode=self._mode, **kwargs) Review comment: better add an extra blank line below. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] Yiyan66 opened a new pull request #17619: [numpy] add op fabs, sometrue, round_
Yiyan66 opened a new pull request #17619: [numpy] add op fabs, sometrue, round_ URL: https://github.com/apache/incubator-mxnet/pull/17619 ## Description ## add op fabs, sometrue, round_ ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes) - [ ] Changes are complete (i.e. I finished coding on this PR) - [ ] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [ ] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - [ ] Feature1, tests, (and when applicable, API doc) - [ ] Feature2, tests, (and when applicable, API doc) ## Comments ## - If this change is a backward incompatible change, why must this change be made. - Interesting edge cases to note here This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet-site] branch asf-site updated: Bump the publish timestamp.
This is an automated email from the ASF dual-hosted git repository. aaronmarkham pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git The following commit(s) were added to refs/heads/asf-site by this push: new ca44428 Bump the publish timestamp. ca44428 is described below commit ca44428eb13c2cfe70982adf57fb8cf021ac3448 Author: mxnet-ci AuthorDate: Tue Feb 18 06:42:25 2020 + Bump the publish timestamp. --- date.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/date.txt b/date.txt new file mode 100644 index 000..559ae47 --- /dev/null +++ b/date.txt @@ -0,0 +1 @@ +Tue Feb 18 06:42:25 UTC 2020
[GitHub] [incubator-mxnet] JiangZhaoh opened a new pull request #17620: Fix flaky test_operator_gpu.test_np_insert
JiangZhaoh opened a new pull request #17620: Fix flaky test_operator_gpu.test_np_insert URL: https://github.com/apache/incubator-mxnet/pull/17620 ## Description ## Fix flaky test_operator_gpu.test_np_insert ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes) - [ ] Changes are complete (i.e. I finished coding on this PR) - [ ] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [ ] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html - [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - [ ] Feature1, tests, (and when applicable, API doc) - [ ] Feature2, tests, (and when applicable, API doc) ## Comments ## - If this change is a backward incompatible change, why must this change be made. - Interesting edge cases to note here This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc
mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380490850 ## File path: src/c_api/c_api.cc ## @@ -581,19 +582,39 @@ int MXLoadLib(const char *path) { // FGradient register lambda auto grad_reg = [=](const nnvm::ObjectPtr& n, const std::vector& ograds) { -// copy gradients first -std::vector heads(ograds.begin(), ograds.end()); -// copy inputs second -for (auto& h : n->inputs) { - heads.push_back(h); -} -// copy outputs last -uint32_t n_out = n->num_outputs(); -for (uint32_t i = 0; i < n_out; ++i) { - heads.emplace_back(n, i, 0); -} -std::string grad_name = "_backward_" + name_str; -return mxnet::op::MakeGradNode(grad_name.c_str(), n, heads, n->attrs.dict); + // create node for gradient + auto p = nnvm::Node::Create(); + std::string grad_name = "_backward_" + name_str; + p->attrs.op = nnvm::Op::Get(grad_name.c_str()); + p->attrs.name = n->attrs.name + "_backward"; Review comment: why do we have two different names - `grad_name` and `p->attrs.name` ? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] haojin2 merged pull request #17541: [numpy] add op random.rayleigh
haojin2 merged pull request #17541: [numpy] add op random.rayleigh URL: https://github.com/apache/incubator-mxnet/pull/17541 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet] branch master updated (0f3c5da -> 4559ab8)
This is an automated email from the ASF dual-hosted git repository. haoj pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git. from 0f3c5da Fix get_started scala gpu (#17434) add 4559ab8 [numpy] add op random.rayleigh (#17541) No new revisions were added by this update. Summary of changes: python/mxnet/ndarray/numpy/random.py | 40 - python/mxnet/numpy/random.py | 30 +- python/mxnet/symbol/numpy/random.py| 38 - src/operator/numpy/random/np_exponential_op.h | 14 ++--- .../{np_exponential_op.cc => np_rayleigh_op.cc}| 46 +++ .../{np_memory_op.cu => random/np_rayleigh_op.cu} | 12 ++-- .../{np_exponential_op.h => np_rayleigh_op.h} | 66 +++--- tests/python/unittest/test_numpy_op.py | 38 + 8 files changed, 214 insertions(+), 70 deletions(-) copy src/operator/numpy/random/{np_exponential_op.cc => np_rayleigh_op.cc} (71%) copy src/operator/numpy/{np_memory_op.cu => random/np_rayleigh_op.cu} (73%) copy src/operator/numpy/random/{np_exponential_op.h => np_rayleigh_op.h} (75%)
[GitHub] [incubator-mxnet] haojin2 commented on issue #17620: Fix flaky test_operator_gpu.test_np_insert
haojin2 commented on issue #17620: Fix flaky test_operator_gpu.test_np_insert URL: https://github.com/apache/incubator-mxnet/pull/17620#issuecomment-587315468 This should fix #17606 @eric-haibin-lin This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17585: Dynamic subgraph property doc
samskalicky commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380493090 ## File path: src/c_api/c_api.cc ## @@ -581,19 +582,39 @@ int MXLoadLib(const char *path) { // FGradient register lambda auto grad_reg = [=](const nnvm::ObjectPtr& n, const std::vector& ograds) { -// copy gradients first -std::vector heads(ograds.begin(), ograds.end()); -// copy inputs second -for (auto& h : n->inputs) { - heads.push_back(h); -} -// copy outputs last -uint32_t n_out = n->num_outputs(); -for (uint32_t i = 0; i < n_out; ++i) { - heads.emplace_back(n, i, 0); -} -std::string grad_name = "_backward_" + name_str; -return mxnet::op::MakeGradNode(grad_name.c_str(), n, heads, n->attrs.dict); + // create node for gradient + auto p = nnvm::Node::Create(); + std::string grad_name = "_backward_" + name_str; + p->attrs.op = nnvm::Op::Get(grad_name.c_str()); + p->attrs.name = n->attrs.name + "_backward"; Review comment: `grad_name` is the name of the registered FGradient operator which is: `"_backward_" + name_str`. it will be the same for all backward nodes of that particular op (think of it as backward op_name) `p->attrs.name` is the unique name of the particular node in the graph, which is: `n->attrs.name + "_backward"`. It will be different for backward nodes of the same op This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-mxnet] branch master updated (0f3c5da -> 4559ab8)
This is an automated email from the ASF dual-hosted git repository. haoj pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git. from 0f3c5da Fix get_started scala gpu (#17434) add 4559ab8 [numpy] add op random.rayleigh (#17541) No new revisions were added by this update. Summary of changes: python/mxnet/ndarray/numpy/random.py | 40 - python/mxnet/numpy/random.py | 30 +- python/mxnet/symbol/numpy/random.py| 38 - src/operator/numpy/random/np_exponential_op.h | 14 ++--- .../{np_exponential_op.cc => np_rayleigh_op.cc}| 46 +++ .../{np_memory_op.cu => random/np_rayleigh_op.cu} | 12 ++-- .../{np_exponential_op.h => np_rayleigh_op.h} | 66 +++--- tests/python/unittest/test_numpy_op.py | 38 + 8 files changed, 214 insertions(+), 70 deletions(-) copy src/operator/numpy/random/{np_exponential_op.cc => np_rayleigh_op.cc} (71%) copy src/operator/numpy/{np_memory_op.cu => random/np_rayleigh_op.cu} (73%) copy src/operator/numpy/random/{np_exponential_op.h => np_rayleigh_op.h} (75%)
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380473885 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. + +Custom partitioners enable users to write custom model partitioning strategies without compiling against all of MXNet header files and dependencies. When a library containing custom partitioners is loaded dynamically, the components found in the library will be re-registered in MXNet so that users can use those natively just like other built-in components. + +## Getting Started + +### Have MXNet Ready + +First you should install MXNet either from compiling from source code or downloading a nightly build. It doesn’t matter if the build comes with CUDA or MKLDNN. The custom partitioning APIs do not interact with the execution of other native MXNet operators. + +### Run An Example + +You can start getting familiar with custom partitioners by running an example provided in the **example/extensions/lib_subgraph** directory. This example partitions `exp` and `log` operators into subgraphs. Go to the `lib_subgraph` directory and follow these steps: + +1. Run `make`. The Makefile will generate a dynamic library **libsubgraph_lib.so** compiled from `subgraph_lib.cc`. This is the library you are going to load that contains everything for the custom partitioner. +2. Run `python test_subgraph.py`. It’ll first load the above library, find the components, register them in the MXNet backend, print "Found x", then partition the model and execute the operators like a regular MXNet operator and output the result. + +### Basic Files For Custom Partitioner Library + +* **lib_subgraph/subgraph_lib.cc**: This file has a source code implementation of all required components to make a custom partitioner, it also shows registration of them so that they can be loaded by MXNet. + +* **lib_subgraph/Makefile**: This file compiles the source code to a dynamic shared library, with a header file `include/mxnet/lib_api.h` from MXNet source code. Currently the custom operator is compatible with C++11 onwards. + +* **lib_subgraph/test_subgraph.py**: This file calls `mx.library.load(‘libsubgraph_lib.so’)` to load the library containing the custom components, partitions the model using the `optimize_for` API, and prints outputs of the forward passes. The outputs should be the same as the regular MXNet forward pass without partitioning. + +## Writing Custom Partitioner Library + +For building a library containing your own custom partitioner, compose a C++ source file like `mypart_lib.cc`, include `lib_api.h` header file, and write your custom partitioner with these essential functions: +- `initialize` - Library Initialization Function +- `REGISTER_PARTITIONER ` - Partitioner Registration Macro +- `mySupportedOps ` - Operator Support + +Then compile it to the `mypart_lib.so` dynamic library using the following command: +```bash +g++ -shared -fPIC -std=c++11 mypart_lib.cc -o libmypart_lib.so -I ../../../include/mxnet +``` + +Finally, you can write a Python script to load the library and partition a model with your custom partitioner: +```python +import mxnet as mx +mx.library.load(‘libmyop_lib.so’) +sym, _, _ = mx.model.load_checkpoint('mymodel', 0) + +# Symbol/Module flow +sym2 = sym.optimize_for("myPart") + +# Gluon flow +sym_block = nn.SymbolBlock(sym, inputs) +sym_block.hybridize(backend='myPart') +``` + +### Writing A Custom Partitioner + +There are several essential building blocks for making a custom partitioner: + +* [initialize](./subgraph_lib.cc#L242): +* This function is the library initialization function necessary for any dynamic libraries. It lets you check if the user is using a compatible version of MXNet. Note that this `version` parameter is passed from MXNet when library is loaded. + +MXReturnValue initialize(int version) + +* [supportedOps](./subgraph_lib.cc#L179): +* This function provides a copy of the model graph as a JSON string, and provides an interface for identifying which operators should be partitioned into a subgraph. Also this is where a custom partitioner can validate the options specified by the user. + +MXReturnValue supportedOps( +std::string json, +const int num_ids, +int *ids, +std::unordered_map& options) + +* [REGISTER_PARTITIONER(m
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380473606 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. + +Custom partitioners enable users to write custom model partitioning strategies without compiling against all of MXNet header files and dependencies. When a library containing custom partitioners is loaded dynamically, the components found in the library will be re-registered in MXNet so that users can use those natively just like other built-in components. + +## Getting Started + +### Have MXNet Ready + +First you should install MXNet either from compiling from source code or downloading a nightly build. It doesn’t matter if the build comes with CUDA or MKLDNN. The custom partitioning APIs do not interact with the execution of other native MXNet operators. + +### Run An Example + +You can start getting familiar with custom partitioners by running an example provided in the **example/extensions/lib_subgraph** directory. This example partitions `exp` and `log` operators into subgraphs. Go to the `lib_subgraph` directory and follow these steps: + +1. Run `make`. The Makefile will generate a dynamic library **libsubgraph_lib.so** compiled from `subgraph_lib.cc`. This is the library you are going to load that contains everything for the custom partitioner. +2. Run `python test_subgraph.py`. It’ll first load the above library, find the components, register them in the MXNet backend, print "Found x", then partition the model and execute the operators like a regular MXNet operator and output the result. + +### Basic Files For Custom Partitioner Library + +* **lib_subgraph/subgraph_lib.cc**: This file has a source code implementation of all required components to make a custom partitioner, it also shows registration of them so that they can be loaded by MXNet. + +* **lib_subgraph/Makefile**: This file compiles the source code to a dynamic shared library, with a header file `include/mxnet/lib_api.h` from MXNet source code. Currently the custom operator is compatible with C++11 onwards. + +* **lib_subgraph/test_subgraph.py**: This file calls `mx.library.load(‘libsubgraph_lib.so’)` to load the library containing the custom components, partitions the model using the `optimize_for` API, and prints outputs of the forward passes. The outputs should be the same as the regular MXNet forward pass without partitioning. + +## Writing Custom Partitioner Library + +For building a library containing your own custom partitioner, compose a C++ source file like `mypart_lib.cc`, include `lib_api.h` header file, and write your custom partitioner with these essential functions: +- `initialize` - Library Initialization Function +- `REGISTER_PARTITIONER ` - Partitioner Registration Macro +- `mySupportedOps ` - Operator Support + +Then compile it to the `mypart_lib.so` dynamic library using the following command: +```bash +g++ -shared -fPIC -std=c++11 mypart_lib.cc -o libmypart_lib.so -I ../../../include/mxnet +``` + +Finally, you can write a Python script to load the library and partition a model with your custom partitioner: +```python +import mxnet as mx +mx.library.load(‘libmyop_lib.so’) +sym, _, _ = mx.model.load_checkpoint('mymodel', 0) + +# Symbol/Module flow +sym2 = sym.optimize_for("myPart") + +# Gluon flow +sym_block = nn.SymbolBlock(sym, inputs) +sym_block.hybridize(backend='myPart') +``` + +### Writing A Custom Partitioner + +There are several essential building blocks for making a custom partitioner: + +* [initialize](./subgraph_lib.cc#L242): +* This function is the library initialization function necessary for any dynamic libraries. It lets you check if the user is using a compatible version of MXNet. Note that this `version` parameter is passed from MXNet when library is loaded. + +MXReturnValue initialize(int version) + +* [supportedOps](./subgraph_lib.cc#L179): +* This function provides a copy of the model graph as a JSON string, and provides an interface for identifying which operators should be partitioned into a subgraph. Also this is where a custom partitioner can validate the options specified by the user. Review comment: can you be specific on validating which options This is an automated message from the Apache Git Service. To respond to the mes
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380469201 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. Review comment: `including operator registration and` should delete `and`. also it is better to break a paragraph into several lines This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380472401 ## File path: src/c_api/c_api.cc ## @@ -724,17 +745,32 @@ int MXLoadLib(const char *path) { regOp.set_attr("FComputeEx", forward_gpu_lambda, plevel); } } -// optionally add fgradient if user specified a function +// optionally add fgradient if user specified a function, or for stateful ops if (backward_ctx_map.size() != 0 || createop_map.size() != 0) { - regOp.set_attr("FGradient", grad_reg, plevel); std::string grad_name = "_backward_" + name_str; nnvm::Op &gradOp = dmlc::Registry::Get()->__REGISTER_OR_GET__(grad_name); + regOp.set_attr("FGradient", grad_reg, plevel); gradOp.set_attr("TIsBackward", true, plevel); - gradOp.set_attr_parser(attr_parser); - gradOp.set_num_inputs(num_inouts); - gradOp.set_num_outputs(num_inputs); gradOp.set_attr("FInferStorageType", infer_storage_type, plevel); gradOp.set_attr("FResourceRequest", resc_req, plevel); + + if (!isSubgraphOp) { +// register attr parser and standard functions for non-subgraph ops +gradOp.set_attr_parser(attr_parser); +gradOp.set_num_inputs(num_inouts); +gradOp.set_num_outputs(num_inputs); + } else { +// for subgraph ops use special functions Review comment: for subgraph ops use special num_inputs functions that doesn't invoke attr_parser This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380470325 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. + +Custom partitioners enable users to write custom model partitioning strategies without compiling against all of MXNet header files and dependencies. When a library containing custom partitioners is loaded dynamically, the components found in the library will be re-registered in MXNet so that users can use those natively just like other built-in components. + +## Getting Started + +### Have MXNet Ready + +First you should install MXNet either from compiling from source code or downloading a nightly build. It doesn’t matter if the build comes with CUDA or MKLDNN. The custom partitioning APIs do not interact with the execution of other native MXNet operators. + +### Run An Example + +You can start getting familiar with custom partitioners by running an example provided in the **example/extensions/lib_subgraph** directory. This example partitions `exp` and `log` operators into subgraphs. Go to the `lib_subgraph` directory and follow these steps: + +1. Run `make`. The Makefile will generate a dynamic library **libsubgraph_lib.so** compiled from `subgraph_lib.cc`. This is the library you are going to load that contains everything for the custom partitioner. +2. Run `python test_subgraph.py`. It’ll first load the above library, find the components, register them in the MXNet backend, print "Found x", then partition the model and execute the operators like a regular MXNet operator and output the result. + +### Basic Files For Custom Partitioner Library + +* **lib_subgraph/subgraph_lib.cc**: This file has a source code implementation of all required components to make a custom partitioner, it also shows registration of them so that they can be loaded by MXNet. + +* **lib_subgraph/Makefile**: This file compiles the source code to a dynamic shared library, with a header file `include/mxnet/lib_api.h` from MXNet source code. Currently the custom operator is compatible with C++11 onwards. + +* **lib_subgraph/test_subgraph.py**: This file calls `mx.library.load(‘libsubgraph_lib.so’)` to load the library containing the custom components, partitions the model using the `optimize_for` API, and prints outputs of the forward passes. The outputs should be the same as the regular MXNet forward pass without partitioning. + +## Writing Custom Partitioner Library + +For building a library containing your own custom partitioner, compose a C++ source file like `mypart_lib.cc`, include `lib_api.h` header file, and write your custom partitioner with these essential functions: +- `initialize` - Library Initialization Function +- `REGISTER_PARTITIONER ` - Partitioner Registration Macro +- `mySupportedOps ` - Operator Support + +Then compile it to the `mypart_lib.so` dynamic library using the following command: Review comment: for all code section please add a new line This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380470220 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. + +Custom partitioners enable users to write custom model partitioning strategies without compiling against all of MXNet header files and dependencies. When a library containing custom partitioners is loaded dynamically, the components found in the library will be re-registered in MXNet so that users can use those natively just like other built-in components. + +## Getting Started + +### Have MXNet Ready + +First you should install MXNet either from compiling from source code or downloading a nightly build. It doesn’t matter if the build comes with CUDA or MKLDNN. The custom partitioning APIs do not interact with the execution of other native MXNet operators. + +### Run An Example + +You can start getting familiar with custom partitioners by running an example provided in the **example/extensions/lib_subgraph** directory. This example partitions `exp` and `log` operators into subgraphs. Go to the `lib_subgraph` directory and follow these steps: + +1. Run `make`. The Makefile will generate a dynamic library **libsubgraph_lib.so** compiled from `subgraph_lib.cc`. This is the library you are going to load that contains everything for the custom partitioner. +2. Run `python test_subgraph.py`. It’ll first load the above library, find the components, register them in the MXNet backend, print "Found x", then partition the model and execute the operators like a regular MXNet operator and output the result. + +### Basic Files For Custom Partitioner Library + +* **lib_subgraph/subgraph_lib.cc**: This file has a source code implementation of all required components to make a custom partitioner, it also shows registration of them so that they can be loaded by MXNet. + +* **lib_subgraph/Makefile**: This file compiles the source code to a dynamic shared library, with a header file `include/mxnet/lib_api.h` from MXNet source code. Currently the custom operator is compatible with C++11 onwards. + +* **lib_subgraph/test_subgraph.py**: This file calls `mx.library.load(‘libsubgraph_lib.so’)` to load the library containing the custom components, partitions the model using the `optimize_for` API, and prints outputs of the forward passes. The outputs should be the same as the regular MXNet forward pass without partitioning. + +## Writing Custom Partitioner Library + +For building a library containing your own custom partitioner, compose a C++ source file like `mypart_lib.cc`, include `lib_api.h` header file, and write your custom partitioner with these essential functions: Review comment: same here, saying copy lib_api.h also works This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] rondogency commented on a change in pull request #17585: Dynamic subgraph property doc
rondogency commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380469935 ## File path: example/extensions/lib_subgraph/README.md ## @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + +Custom Partitioner Example and Tutorial +=== + +## Introduction + +Adding custom model partitioners in MXNet used to require deep understanding of the MXNet backend, including operator registration and, followed by recompiling MXNet from source with all of its dependencies. This feature allows adding custom partitioners by dynamically loading custom C++ partitioners compiled in external libraries at runtime. + +Custom partitioners enable users to write custom model partitioning strategies without compiling against all of MXNet header files and dependencies. When a library containing custom partitioners is loaded dynamically, the components found in the library will be re-registered in MXNet so that users can use those natively just like other built-in components. + +## Getting Started + +### Have MXNet Ready + +First you should install MXNet either from compiling from source code or downloading a nightly build. It doesn’t matter if the build comes with CUDA or MKLDNN. The custom partitioning APIs do not interact with the execution of other native MXNet operators. Review comment: can you edit this to be similar to custom op doc since it has been revised by Aaron https://github.com/apache/incubator-mxnet/tree/master/example/extensions/lib_custom_op This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc
mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380494193 ## File path: src/c_api/c_api.cc ## @@ -724,17 +745,32 @@ int MXLoadLib(const char *path) { regOp.set_attr("FComputeEx", forward_gpu_lambda, plevel); } } -// optionally add fgradient if user specified a function +// optionally add fgradient if user specified a function, or for stateful ops if (backward_ctx_map.size() != 0 || createop_map.size() != 0) { - regOp.set_attr("FGradient", grad_reg, plevel); std::string grad_name = "_backward_" + name_str; nnvm::Op &gradOp = dmlc::Registry::Get()->__REGISTER_OR_GET__(grad_name); + regOp.set_attr("FGradient", grad_reg, plevel); gradOp.set_attr("TIsBackward", true, plevel); - gradOp.set_attr_parser(attr_parser); - gradOp.set_num_inputs(num_inouts); - gradOp.set_num_outputs(num_inputs); gradOp.set_attr("FInferStorageType", infer_storage_type, plevel); gradOp.set_attr("FResourceRequest", resc_req, plevel); + + if (!isSubgraphOp) { +// register attr parser and standard functions for non-subgraph ops +gradOp.set_attr_parser(attr_parser); +gradOp.set_num_inputs(num_inouts); +gradOp.set_num_outputs(num_inputs); + } else { +// for subgraph ops use special functions +using namespace mxnet::op; +auto grad_inouts = [=](const nnvm::NodeAttrs& attrs) { + uint32_t cnt = DefaultSubgraphOpNumInputs(attrs); + cnt += 2 * DefaultSubgraphOpNumOutputs(attrs); + return cnt; +}; +gradOp.set_num_inputs(grad_inouts); +gradOp.set_num_outputs(DefaultSubgraphOpNumInputs); Review comment: are we assigning a function `DefaultSubgraphOpNumInputs` as number of outputs? shouldn't it be a variable as for inputs? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc
mseth10 commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380495190 ## File path: src/c_api/c_api.cc ## @@ -581,19 +582,39 @@ int MXLoadLib(const char *path) { // FGradient register lambda auto grad_reg = [=](const nnvm::ObjectPtr& n, const std::vector& ograds) { -// copy gradients first -std::vector heads(ograds.begin(), ograds.end()); -// copy inputs second -for (auto& h : n->inputs) { - heads.push_back(h); -} -// copy outputs last -uint32_t n_out = n->num_outputs(); -for (uint32_t i = 0; i < n_out; ++i) { - heads.emplace_back(n, i, 0); -} -std::string grad_name = "_backward_" + name_str; -return mxnet::op::MakeGradNode(grad_name.c_str(), n, heads, n->attrs.dict); + // create node for gradient + auto p = nnvm::Node::Create(); + std::string grad_name = "_backward_" + name_str; + p->attrs.op = nnvm::Op::Get(grad_name.c_str()); + p->attrs.name = n->attrs.name + "_backward"; Review comment: Okay, why can't `n->attrs.name` be same for two different nodes of same operator? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on a change in pull request #17585: Dynamic subgraph property doc
samskalicky commented on a change in pull request #17585: Dynamic subgraph property doc URL: https://github.com/apache/incubator-mxnet/pull/17585#discussion_r380495712 ## File path: src/c_api/c_api.cc ## @@ -581,19 +582,39 @@ int MXLoadLib(const char *path) { // FGradient register lambda auto grad_reg = [=](const nnvm::ObjectPtr& n, const std::vector& ograds) { -// copy gradients first -std::vector heads(ograds.begin(), ograds.end()); -// copy inputs second -for (auto& h : n->inputs) { - heads.push_back(h); -} -// copy outputs last -uint32_t n_out = n->num_outputs(); -for (uint32_t i = 0; i < n_out; ++i) { - heads.emplace_back(n, i, 0); -} -std::string grad_name = "_backward_" + name_str; -return mxnet::op::MakeGradNode(grad_name.c_str(), n, heads, n->attrs.dict); + // create node for gradient + auto p = nnvm::Node::Create(); + std::string grad_name = "_backward_" + name_str; + p->attrs.op = nnvm::Op::Get(grad_name.c_str()); + p->attrs.name = n->attrs.name + "_backward"; Review comment: node names have to be unique This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services