You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

checker.h 21 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. /**
  2. * \file dnn/test/common/checker.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  6. *
  7. * Unless required by applicable law or agreed to in writing,
  8. * software distributed under the License is distributed on an
  9. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. */
  11. #pragma once
  12. #include "megdnn/basic_types.h"
  13. #include "megdnn/tensor_iter.h"
  14. #include "test/common/opr_algo_proxy.h"
  15. #include "test/common/opr_proxy.h"
  16. #include "test/common/rng.h"
  17. #include <gtest/gtest.h>
  18. #include <memory>
  19. #include <regex>
  20. #include <unordered_map>
  21. // clang-format off
  22. #if defined(__has_feature)
  23. #if __has_feature(address_sanitizer)
  24. #define MEGDNN_TEST_ASAN 1
  25. #else
  26. #define MEGDNN_TEST_ASAN 0
  27. #endif
  28. #elif defined(__SANITIZE_ADDRESS__)
  29. #define MEGDNN_TEST_ASAN 1
  30. #else
  31. #define MEGDNN_TEST_ASAN 0
  32. #endif
  33. // clang-format on
  34. namespace megdnn {
  35. namespace test {
  36. class CheckerHelper {
  37. // TensorLayoutArray and TensorValueArray should be protected in theory;
  38. // but g++-4.9 bugs handle access privilege wrongfully, so we change it
  39. // to public.
  40. public:
  41. using TensorValueArray = TensorNDArray;
  42. using TensorsConstriant = std::function<void(TensorValueArray& tensors)>;
  43. using ExtraOprImpl = std::function<void(const TensorNDArray&)>;
  44. using OutputCanonizer = std::function<void(const TensorValueArray&)>;
  45. static std::shared_ptr<TensorValueArray> alloc_tensors(
  46. Handle* handle, const TensorLayoutArray& layouts, size_t offset);
  47. Handle* handle() const { return m_handle_cur; }
  48. protected:
  49. //! whether to use physically contiguous (i.e. default layout) for naive
  50. //! impl
  51. bool m_enable_contig_naive = false;
  52. bool m_prev_succ = true;
  53. const char* m_input_tensors_fpath = nullptr;
  54. thin_function<void()> m_expect_exec_fail;
  55. std::unique_ptr<Handle> m_handle_naive;
  56. Handle* m_handle_cur;
  57. std::unique_ptr<RNG> m_default_rng;
  58. std::unordered_map<size_t, RNG*> m_rng;
  59. std::unordered_map<size_t, DType> m_dtype;
  60. std::unordered_map<size_t, TensorFormat> m_fmt;
  61. float_t m_epsilon = 1e-3, m_max_avg_error = 1e-3,
  62. m_max_avg_biased_error = 1e-3;
  63. float_t m_perf_check_threshold = -1;
  64. bool m_perf_check = false;
  65. ExtraOprImpl m_extra_opr_impl;
  66. OutputCanonizer m_output_canonizer;
  67. TensorsConstriant m_tensor_constraint;
  68. bool no_naive_and_check = false;
  69. /**
  70. * the offset from the start of malloc memory
  71. *
  72. * \note alloc \p m_offset more memory when alloc memory for a tensor,
  73. * the start of tensor just begin at \p m_offset.
  74. * \warning current only used for opencl
  75. */
  76. size_t m_offset = 0;
  77. CheckerHelper(Handle* handle, bool check_dispatch = true);
  78. ~CheckerHelper() noexcept;
  79. using OprExec = std::function<void(const TensorValueArray&)>;
  80. void do_exec_with_testcases(const TensorValueArray& testcase_in,
  81. const TensorValueArray& testcase_out,
  82. const OprExec& exec_opr);
  83. void do_exec(const TensorLayoutArray& user_layouts,
  84. const TensorLayoutArray& deduced_layouts,
  85. const OprExec& exec_naive, const OprExec& exec_opr);
  86. void enable_contig_naive() { m_enable_contig_naive = true; }
  87. void copy_tensors_to_device(const TensorValueArray& dest,
  88. const TensorValueArray& src);
  89. void copy_tensors_from_device(const TensorValueArray& dest,
  90. const TensorValueArray& src);
  91. private:
  92. std::shared_ptr<TensorValueArray> m_tensors_naive;
  93. void init_naive_values();
  94. void check_tensors(const TensorValueArray& expected,
  95. const TensorValueArray& computed);
  96. };
  97. template <typename Opr, typename Proxy = OprProxy<Opr>>
  98. class Checker : public CheckerHelper {
  99. public:
  100. using Param = typename Opr::Param;
  101. using BeforeExecCallback =
  102. std::function<void(Opr*, const TensorValueArray&)>;
  103. Checker(Handle* handle, bool check_dispatch = true)
  104. : CheckerHelper(handle, check_dispatch), m_param(Param()) {}
  105. TensorLayoutArray make_layouts(const TensorShapeArray& shapes) {
  106. TensorLayoutArray layouts(shapes.size());
  107. for (size_t i = 0; i < shapes.size(); ++i) {
  108. DType dt = (m_dtype.find(i) != m_dtype.end() ? m_dtype[i]
  109. : dtype::Float32());
  110. TensorFormat fmt =
  111. (m_fmt.find(i) != m_fmt.end() ? m_fmt[i] : TensorFormat{});
  112. layouts[i] = TensorLayout(shapes[i], dt, fmt);
  113. }
  114. return layouts;
  115. }
  116. /*!
  117. * \brief execute opr on current param/dtype/rng config
  118. * \param shapes input/output shapes, which would be passed as
  119. * arguments to Opr::deduce_layout
  120. *
  121. * Checker would construct TensorLayout vectors from shapes and dtypes,
  122. * and call exec(TensorLayoutArray &).
  123. */
  124. Checker& exec(const TensorShapeArray& shapes) {
  125. exec(make_layouts(shapes));
  126. return *this;
  127. }
  128. void exec(TensorLayoutArray layouts);
  129. //! explicitly require argument to be TensorShape
  130. Checker& execs(const TensorShapeArray& shapes) { return exec(shapes); }
  131. //! explicitly require argument to be TensorLayout
  132. Checker& execl(const TensorLayoutArray& layouts) {
  133. exec(layouts);
  134. return *this;
  135. }
  136. Checker& exect(const TensorValueArray& testcase_in,
  137. const TensorValueArray& testcase_out);
  138. Checker& set_param(Param param) {
  139. m_param = param;
  140. opr()->param() = param;
  141. return *this;
  142. }
  143. Checker& set_dtype(size_t idx, DType dtype) {
  144. m_dtype[idx] = dtype;
  145. return *this;
  146. }
  147. Checker& set_fmt(size_t idx, TensorFormat fmt) {
  148. m_fmt[idx] = fmt;
  149. return *this;
  150. }
  151. Checker& set_rng(size_t idx, RNG* rng) {
  152. m_rng[idx] = rng;
  153. return *this;
  154. }
  155. //! max error of a single element
  156. Checker& set_epsilon(dt_float32 epsilon) {
  157. m_epsilon = epsilon;
  158. m_max_avg_error = epsilon;
  159. m_max_avg_biased_error = epsilon;
  160. return *this;
  161. }
  162. //! max average error; defaults to epsilon
  163. Checker& set_max_avg_error(dt_float32 error) {
  164. m_max_avg_error = error;
  165. return *this;
  166. }
  167. //! max average biased error; defaults to epsilon
  168. Checker& set_max_avg_biased_error(dt_float32 error) {
  169. m_max_avg_biased_error = error;
  170. return *this;
  171. }
  172. Checker& set_offset(size_t offset) {
  173. m_offset = offset;
  174. return *this;
  175. }
  176. Checker& set_proxy(const Proxy& proxy) {
  177. m_naive_proxy = proxy;
  178. m_cur_proxy = proxy;
  179. return *this;
  180. }
  181. //! set_perf_check and set_perf_check_threshold control the
  182. //! performance checking behavior.
  183. //!
  184. //! If perf_check is on (default to off), the running time of the
  185. //! current operator and the naive operator would be measured and
  186. //! checked when calling exec.
  187. //! The accelerating ratio should be larger than perf_check_threshold,
  188. //! otherwise errors would be reported.
  189. //! perf_check_threshold must be set in advance since the default value
  190. //! (which is negative) is invalid.
  191. Checker& set_perf_check(bool perf_check) {
  192. m_perf_check = perf_check;
  193. return *this;
  194. }
  195. Checker& set_perf_check_threshold(float perf_check_threshold) {
  196. m_perf_check_threshold = perf_check_threshold;
  197. return *this;
  198. }
  199. //! load input tensors from file for next run
  200. Checker& load_input_tensors(const char* fpath) {
  201. m_input_tensors_fpath = fpath;
  202. return *this;
  203. }
  204. //! add another checker to ensure naive implementation is correct
  205. Checker& set_extra_opr_impl(const ExtraOprImpl& chk) {
  206. m_extra_opr_impl = chk;
  207. return *this;
  208. }
  209. //! set a callback to be invoked before executing the operator
  210. Checker& set_before_exec_callback(const BeforeExecCallback& cb) {
  211. m_before_exec_callback = cb;
  212. return *this;
  213. }
  214. Checker& reset_before_exec_callback() {
  215. m_before_exec_callback = nullptr;
  216. return *this;
  217. }
  218. //! set a tensors constraints function, for the purpose of manipulating
  219. //! tensors when testing.
  220. Checker& set_tensors_constraint(
  221. const TensorsConstriant& tensor_constraint) {
  222. m_tensor_constraint = tensor_constraint;
  223. return *this;
  224. }
  225. /*!
  226. * \brief set that exec() on opr should fail, so naive is not called and
  227. * exec() returns directly after opr is called.
  228. *
  229. * This is only valid for next exec() call. It is usually used for
  230. * testing megcore::AsyncErrorInfo.
  231. *
  232. * \param cb callback to be invoked after opr exec (so error would not
  233. * be passed to destructor)
  234. */
  235. Checker& set_expect_exec_fail(const thin_function<void()>& cb) {
  236. m_expect_exec_fail = cb;
  237. return *this;
  238. }
  239. /*!
  240. * \brief set a function to canonize the outputs
  241. *
  242. * For some oprs maybe multiple outputs can be accepted; we can use a
  243. * function to transform them into a canonized form before comparing.
  244. *
  245. * The arguments are tensors on CPU and should be modified in-place.
  246. */
  247. Checker& set_output_canonizer(OutputCanonizer canonizer) {
  248. m_output_canonizer = std::move(canonizer);
  249. return *this;
  250. }
  251. //! get the opr impl so setting other than param() can be modified
  252. Opr* opr() {
  253. if (!m_opr_cur) {
  254. m_opr_cur = m_handle_cur->create_operator<Opr>();
  255. }
  256. return m_opr_cur.get();
  257. }
  258. //! whether previous exec succeeds
  259. bool prev_succ() const { return m_prev_succ; }
  260. private:
  261. BeforeExecCallback m_before_exec_callback;
  262. Param m_param;
  263. Proxy m_naive_proxy, m_cur_proxy;
  264. std::unique_ptr<Opr> m_opr_cur;
  265. };
  266. ::testing::AssertionResult __assert_tensor_eq(
  267. const char* expr0, const char* expr1, const char* expr_maxerr,
  268. const char* expr_maxerr_avg, const char* expr_maxerr_avg_biased,
  269. const TensorND& v0, const TensorND& v1, float maxerr, float maxerr_avg,
  270. float maxerr_avg_biased);
  271. #define MEGDNN_ASSERT_TENSOR_EQ_EPS_AVG(v0, v1, maxerr, maxerr_avg, \
  272. maxerr_avg_biased) \
  273. ASSERT_PRED_FORMAT5(::megdnn::test::__assert_tensor_eq, v0, v1, maxerr, \
  274. maxerr_avg, maxerr_avg_biased)
  275. #define MEGDNN_ASSERT_TENSOR_EQ_EPS(v0, v1, maxerr) \
  276. MEGDNN_ASSERT_TENSOR_EQ_EPS_AVG(v0, v1, maxerr, maxerr, maxerr)
  277. #define MEGDNN_ASSERT_TENSOR_EQ(v0, v1) \
  278. MEGDNN_ASSERT_TENSOR_EQ_EPS(v0, v1, 1e-3)
  279. template <typename Opr, typename Proxy>
  280. void Checker<Opr, Proxy>::exec(TensorLayoutArray layouts) {
  281. auto opr_naive = m_handle_naive->create_operator<Opr>();
  282. auto opr_relayout = m_handle_naive->create_operator<RelayoutForward>();
  283. auto opr_cur = this->opr();
  284. opr_naive->param() = m_param;
  285. opr_cur->param() = m_param;
  286. m_naive_proxy.deduce_layout(opr_naive.get(), layouts);
  287. auto exec_naive = [this, &opr_naive, &layouts,
  288. &opr_relayout](const TensorValueArray& values) {
  289. TensorValueArray contig_values = values;
  290. TensorValueArray real_values = values;
  291. std::shared_ptr<TensorValueArray> tensors_naive_contig_storage;
  292. if (m_enable_contig_naive) {
  293. TensorLayoutArray contig_layouts;
  294. for (auto&& layout : layouts) {
  295. contig_layouts.emplace_back(TensorLayout{
  296. static_cast<const TensorShape&>(layout), layout.dtype});
  297. }
  298. m_naive_proxy.deduce_layout(opr_naive.get(), contig_layouts);
  299. tensors_naive_contig_storage = alloc_tensors(
  300. m_handle_naive.get(), contig_layouts, m_offset);
  301. contig_values = *tensors_naive_contig_storage;
  302. //! relayout value to the contig_values
  303. for (size_t i = 0; i < contig_values.size(); ++i) {
  304. if (real_values[i].layout.ndim == 0)
  305. continue;
  306. real_values[i].layout.format = {};
  307. opr_relayout->exec(real_values[i], contig_values[i],
  308. m_handle_naive.get());
  309. }
  310. }
  311. m_naive_proxy.exec(opr_naive.get(), contig_values);
  312. if (m_enable_contig_naive) {
  313. //! relayout to the values
  314. for (size_t i = 0; i < contig_values.size(); ++i) {
  315. if (real_values[i].layout.ndim == 0)
  316. continue;
  317. opr_relayout->exec(contig_values[i], real_values[i],
  318. m_handle_naive.get());
  319. }
  320. }
  321. };
  322. auto exec_opr = [this, opr_cur](const TensorValueArray& values) {
  323. if (m_before_exec_callback) {
  324. m_before_exec_callback(opr_cur, values);
  325. }
  326. m_cur_proxy.exec(opr_cur, values);
  327. };
  328. auto user_layouts = layouts;
  329. do_exec(user_layouts, layouts, exec_naive, exec_opr);
  330. }
  331. template <typename Opr, typename Proxy>
  332. Checker<Opr, Proxy>& Checker<Opr, Proxy>::exect(
  333. const TensorValueArray& testcase_in,
  334. const TensorValueArray& testcase_out) {
  335. auto opr_cur = this->opr();
  336. opr_cur->param() = m_param;
  337. auto exec_opr = [this, opr_cur](const TensorValueArray& values) {
  338. if (m_before_exec_callback) {
  339. m_before_exec_callback(opr_cur, values);
  340. }
  341. m_cur_proxy.exec(opr_cur, values);
  342. };
  343. do_exec_with_testcases(testcase_in, testcase_out, exec_opr);
  344. return *this;
  345. }
  346. template <typename T, typename U>
  347. TensorND TensorValue(const TensorShape& shape, T dtype,
  348. std::initializer_list<U> values) {
  349. TensorND tensor;
  350. tensor.layout = {shape, dtype};
  351. tensor.raw_ptr =
  352. static_cast<dt_byte*>(malloc(tensor.layout.span().dist_byte()));
  353. megdnn_assert(values.size() == tensor.layout.total_nr_elems(), "%zu == %zu",
  354. values.size(), tensor.layout.total_nr_elems());
  355. auto ptr = tensor.ptr<typename DTypeTrait<T>::ctype>();
  356. for (const auto& v : values) {
  357. *ptr++ = typename DTypeTrait<T>::ctype(v);
  358. }
  359. return tensor;
  360. }
  361. template <typename T, typename U>
  362. TensorND TensorValueLowbit4(const TensorShape& shape, T dtype,
  363. std::vector<U> values) {
  364. TensorND tensor;
  365. tensor.layout = {shape, dtype};
  366. tensor.raw_ptr =
  367. static_cast<dt_byte*>(malloc(tensor.layout.span().dist_byte()));
  368. megdnn_assert(values.size() == tensor.layout.total_nr_elems());
  369. auto ptr = static_cast<U*>(tensor.raw_ptr);
  370. for (size_t i = 0; i < values.size(); i += 2) {
  371. U val0 = values[i], val1 = values[i + 1];
  372. megdnn_assert(val0 >= DTypeTrait<T>::min());
  373. megdnn_assert(val1 <= DTypeTrait<T>::max());
  374. ptr[i / 2] = (val0 & 0xF) | (val1 << 4);
  375. }
  376. return tensor;
  377. }
  378. class Testcase : public SmallVector<TensorND> {
  379. public:
  380. using SmallVector<TensorND>::SmallVector;
  381. ~Testcase() {
  382. // Suicide
  383. for (const auto& tensor : *this) {
  384. if (tensor.raw_ptr) {
  385. free(tensor.raw_ptr);
  386. }
  387. }
  388. }
  389. Testcase(const Testcase&) = delete;
  390. Testcase operator=(const Testcase&) = delete;
  391. };
  392. struct ExecutionPolicyAlgoName {
  393. std::string name;
  394. std::vector<ExecutionPolicyAlgoName> sub_policy_names;
  395. ExecutionPolicyAlgoName(const char* name) : name{name} {}
  396. ExecutionPolicyAlgoName(
  397. const char* name,
  398. const std::vector<ExecutionPolicyAlgoName>& sub_policy)
  399. : name{name}, sub_policy_names{sub_policy} {}
  400. };
  401. /*!
  402. * \brief a callable to check that given algorithm is used for heuristic
  403. * \param require_algo if its value is true, then requires
  404. * get_algorithm_heuristic() to return the expected algo; otherwise the
  405. * expected algo must exist in get_all_algorithms() and it would be set to
  406. * be used
  407. */
  408. template <class Opr, typename OprAlgoProxy = OprAlgoProxy<Opr>>
  409. class AlgoChecker {
  410. public:
  411. AlgoChecker(ExecutionPolicyAlgoName name, bool* require_algo = nullptr)
  412. : m_policy_name{name}, m_require_algo{require_algo} {}
  413. AlgoChecker(ExecutionPolicy policy, bool* require_algo = nullptr)
  414. : m_policy{policy}, m_require_algo{require_algo} {}
  415. static ExecutionPolicy construct_execution_policy_from_name(
  416. const ExecutionPolicyAlgoName& policy_name,
  417. const TensorLayoutArray& layouts, const std::string& param,
  418. Handle* handle) {
  419. ExecutionPolicy ret;
  420. megdnn_assert(layouts.size() == OprTrait<Opr>::arity);
  421. auto opr = handle->create_operator<Opr>();
  422. opr->param() =
  423. Algorithm::deserialize_read_pod<typename Opr::Param>(param);
  424. for (auto algo_info :
  425. AlgoProxy<Opr, OprTrait<Opr>::arity>::get_all_algorithms_info(
  426. opr.get(), layouts)) {
  427. if (std::regex_match(
  428. algo_info.desc.name,
  429. std::regex("(" + policy_name.name + ")(.*)"))) {
  430. ret.algo = algo_info.desc;
  431. } else {
  432. continue;
  433. }
  434. Algorithm* algo = opr->get_algorithm_from_desc(algo_info.desc);
  435. std::vector<Algorithm::SearchItem>&& sub_items =
  436. algo->get_subopr_list(layouts, opr.get());
  437. if (sub_items.size() != policy_name.sub_policy_names.size()) {
  438. printf("Invalid sub_policy_names in %s, expected %zu but got "
  439. "%zu\n",
  440. algo_info.desc.name.c_str(), sub_items.size(),
  441. policy_name.sub_policy_names.size());
  442. return {};
  443. }
  444. FOREACH_OPR_TYPE_DISPATCH(sub_items, {
  445. ExecutionPolicy policy =
  446. AlgoChecker<_Opr>::construct_execution_policy_from_name(
  447. policy_name.sub_policy_names[_item_idx],
  448. _item.layouts, _item.param, handle);
  449. ret.sub_policy.push_back(policy);
  450. });
  451. return ret;
  452. }
  453. return ret;
  454. }
  455. void operator()(Opr* opr, const CheckerHelper::TensorValueArray& arr) {
  456. TensorLayoutArray layouts;
  457. for (auto&& val : arr) {
  458. layouts.push_back(val.layout);
  459. }
  460. if (!m_policy_name.name.empty()) {
  461. std::string param_str;
  462. Algorithm::serialize_write_pod(opr->param(), param_str);
  463. m_policy = construct_execution_policy_from_name(
  464. m_policy_name, layouts, param_str, opr->handle());
  465. ASSERT_TRUE(m_policy.algo.valid())
  466. << "algorithm " << m_policy_name.name << " not found";
  467. }
  468. if (m_require_algo && *m_require_algo) {
  469. auto algo =
  470. OprAlgoProxy::get_algorithm_info_heuristic(opr, layouts);
  471. ASSERT_STREQ(opr->get_algorithm_from_desc(m_policy.algo)->name(),
  472. algo.desc.name.c_str());
  473. } else {
  474. opr->execution_policy() = m_policy;
  475. }
  476. }
  477. private:
  478. ExecutionPolicyAlgoName m_policy_name;
  479. ExecutionPolicy m_policy;
  480. bool* m_require_algo;
  481. };
  482. template <typename Opr>
  483. void construct_sub_execution_policy_heuristic(ExecutionPolicy& policy,
  484. const TensorLayoutArray& layouts,
  485. const std::string& param,
  486. Handle* handle) {
  487. megdnn_assert(layouts.size() == OprTrait<Opr>::arity);
  488. auto opr = handle->create_operator<Opr>();
  489. opr->param() = Algorithm::deserialize_read_pod<typename Opr::Param>(param);
  490. if (!policy.algo.valid()) {
  491. policy.algo = AlgoProxy<Opr, OprTrait<Opr>::arity>::
  492. get_algorithm_info_heuristic(opr.get(), layouts).desc;
  493. }
  494. Algorithm* algo = opr->get_algorithm_from_desc(policy.algo);
  495. std::vector<Algorithm::SearchItem>&& sub_items =
  496. algo->get_subopr_list(layouts, opr.get());
  497. FOREACH_OPR_TYPE_DISPATCH(sub_items, {
  498. policy.sub_policy.push_back(ExecutionPolicy{});
  499. construct_sub_execution_policy_heuristic<_Opr>(
  500. policy.sub_policy.back(), _item.layouts, _item.param,
  501. handle);
  502. });
  503. }
  504. } // namespace test
  505. } // namespace megdnn
  506. // vim: syntax=cpp.doxygen

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台