cumo 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/ext/cumo/cuda/cudnn_impl.cpp +4 -1
- data/ext/cumo/include/cumo.h +2 -2
- data/ext/cumo/include/cumo/types/dfloat.h +1 -1
- data/ext/cumo/include/cumo/types/dfloat_kernel.h +1 -1
- data/ext/cumo/include/cumo/types/sfloat.h +1 -1
- data/ext/cumo/include/cumo/types/sfloat_kernel.h +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b17317cc0df56b966f0455be514318920624fb5869e45d442a81d3f71ee9e9d
|
4
|
+
data.tar.gz: 50e06b7373b2d0a97c6c715686fc7a38b58fbeb86d17aa8ad189e0a1d9828a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f558130296b89c55e5d506673dd3376274f95c57970cd6aa17d686e69c2e23e41d85a16fdfb84fcb7a4acc6addbd67ea855800de8eb1fa1e6b1bf4d061894109
|
7
|
+
data.tar.gz: 642442d479765d459286474a514e047ab80273b9357b357f5509054f27cd52c27562f57c8af53a4efa5d8cb24afd4c2949afe1f2b962b9046ea4fd23935666b1
|
data/CHANGELOG.md
CHANGED
@@ -210,6 +210,7 @@ static void HashCombine(std::size_t& seed, std::size_t hash_value) {
|
|
210
210
|
|
211
211
|
// Partially Borrowed from ChainerX
|
212
212
|
struct AlgoCacheKey {
|
213
|
+
int device_id;
|
213
214
|
size_t ndim; // # of spatial dimensions
|
214
215
|
size_t x_shape[CUMO_NA_MAX_DIMENSION];
|
215
216
|
size_t w_shape[CUMO_NA_MAX_DIMENSION];
|
@@ -220,6 +221,7 @@ struct AlgoCacheKey {
|
|
220
221
|
size_t max_workspace_size;
|
221
222
|
|
222
223
|
bool operator==(const AlgoCacheKey& other) const {
|
224
|
+
if (device_id != other.device_id) return false;
|
223
225
|
if (ndim != other.ndim) return false;
|
224
226
|
if (dtype != other.dtype) return false;
|
225
227
|
if (max_workspace_size != other.max_workspace_size) return false;
|
@@ -249,6 +251,7 @@ struct AlgoCacheKeyHash {
|
|
249
251
|
std::size_t operator()(const AlgoCacheKey& key) const {
|
250
252
|
std::size_t seed = 0;
|
251
253
|
size_t ndim = key.ndim;
|
254
|
+
HashCombine(seed, std::hash<int>()(key.device_id));
|
252
255
|
HashCombine(seed, std::hash<size_t>()(key.ndim));
|
253
256
|
for (size_t idim = 0; idim < ndim + 2; ++idim) {
|
254
257
|
HashCombine(seed, std::hash<size_t>()(key.x_shape[idim]));
|
@@ -275,7 +278,6 @@ using FwdAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolut
|
|
275
278
|
using BwdDataAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolutionBwdDataAlgo_t, size_t>, AlgoCacheKeyHash>;
|
276
279
|
using BwdFilterAlgoCacheMap = std::unordered_map<AlgoCacheKey, std::pair<cudnnConvolutionBwdFilterAlgo_t, size_t>, AlgoCacheKeyHash>;
|
277
280
|
|
278
|
-
// TODO: Another cache for another device
|
279
281
|
static FwdAlgoCacheMap fwd_algo_cache_map_{};
|
280
282
|
static BwdDataAlgoCacheMap bwd_data_algo_cache_map_{};
|
281
283
|
static BwdFilterAlgoCacheMap bwd_filter_algo_cache_map_{};
|
@@ -304,6 +306,7 @@ cumo_cuda_cudnn_FindConvolutionForwardAlgorithm(
|
|
304
306
|
CumoGetNArray(y, ny);
|
305
307
|
|
306
308
|
auto key = AlgoCacheKey{};
|
309
|
+
cumo_cuda_runtime_check_status(cudaGetDevice(&(key.device_id)));
|
307
310
|
key.ndim = ndim;
|
308
311
|
for (size_t idim = 0; idim < ndim + 2; ++idim) {
|
309
312
|
key.x_shape[idim] = nx->shape[idim];
|
data/ext/cumo/include/cumo.h
CHANGED
@@ -44,5 +44,5 @@ inline static void m_rand_norm(dtype mu, dtype sigma, dtype *a0, dtype *a1)
|
|
44
44
|
#define M_MIN rb_float_new(2.2250738585072014e-308)
|
45
45
|
#define M_MAX rb_float_new(1.7976931348623157e+308)
|
46
46
|
|
47
|
-
#define DATA_MIN
|
47
|
+
#define DATA_MIN -DBL_MAX
|
48
48
|
#define DATA_MAX DBL_MAX
|
@@ -45,5 +45,5 @@ inline static void m_rand_norm(dtype mu, dtype sigma, dtype *a0, dtype *a1)
|
|
45
45
|
#define M_MIN rb_float_new(1.1754943508222875e-38)
|
46
46
|
#define M_MAX rb_float_new(3.4028234663852886e+38)
|
47
47
|
|
48
|
-
#define DATA_MIN
|
48
|
+
#define DATA_MIN -FLT_MAX
|
49
49
|
#define DATA_MAX FLT_MAX
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cumo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: numo-narray
|