@@ -54,6 +54,60 @@ http_archive(
54
54
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.2.3.zip" ,
55
55
)
56
56
57
+ http_archive (
58
+ name = "hkv" ,
59
+ build_file = "//build_deps/toolchains/hkv:hkv.BUILD" ,
60
+ # TODO(LinGeLin) remove this when update hkv
61
+ patch_cmds = [
62
+ """sed -i.bak '1772i\\ '$'\\ n ThrustAllocator<uint8_t> thrust_allocator_;\\ n' include/merlin_hashtable.cuh""" ,
63
+ """sed -i.bak '225i\\ '$'\\ n thrust_allocator_.set_allocator(allocator_);\\ n' include/merlin_hashtable.cuh""" ,
64
+ "sed -i.bak 's/thrust::sort_by_key(thrust_par.on(stream)/thrust::sort_by_key(thrust_par(thrust_allocator_).on(stream)/' include/merlin_hashtable.cuh" ,
65
+ "sed -i.bak 's/reduce(thrust_par.on(stream)/reduce(thrust_par(thrust_allocator_).on(stream)/' include/merlin_hashtable.cuh" ,
66
+ """sed -i.bak '125i\\ '$'\\ n template <typename T>\\ n' include/merlin/allocator.cuh""" ,
67
+ """sed -i.bak '126i\\ '$'\\ n struct ThrustAllocator : thrust::device_malloc_allocator<T> {\\ n' include/merlin/allocator.cuh""" ,
68
+ """sed -i.bak '127i\\ '$'\\ n public:\\ n' include/merlin/allocator.cuh""" ,
69
+ """sed -i.bak '128i\\ '$'\\ n typedef thrust::device_malloc_allocator<T> super_t;\\ n' include/merlin/allocator.cuh""" ,
70
+ """sed -i.bak '129i\\ '$'\\ n typedef typename super_t::pointer pointer;\\ n' include/merlin/allocator.cuh""" ,
71
+ """sed -i.bak '130i\\ '$'\\ n typedef typename super_t::size_type size_type;\\ n' include/merlin/allocator.cuh""" ,
72
+ """sed -i.bak '131i\\ '$'\\ n public:\\ n' include/merlin/allocator.cuh""" ,
73
+ """sed -i.bak '132i\\ '$'\\ n pointer allocate(size_type n) {\\ n' include/merlin/allocator.cuh""" ,
74
+ """sed -i.bak '133i\\ '$'\\ n void* ptr = nullptr;\\ n' include/merlin/allocator.cuh""" ,
75
+ """sed -i.bak '134i\\ '$'\\ n MERLIN_CHECK(\\ n' include/merlin/allocator.cuh""" ,
76
+ """sed -i.bak '135i\\ '$'\\ n allocator_ != nullptr,\\ n' include/merlin/allocator.cuh""" ,
77
+ """sed -i.bak '136i\\ '$'\\ n "[ThrustAllocator] set_allocator should be called in advance!");\\ n' include/merlin/allocator.cuh""" ,
78
+ """sed -i.bak '137i\\ '$'\\ n allocator_->alloc(MemoryType::Device, &ptr, sizeof(T) * n);\\ n' include/merlin/allocator.cuh""" ,
79
+ """sed -i.bak '138i\\ '$'\\ n return pointer(reinterpret_cast<T*>(ptr));\\ n' include/merlin/allocator.cuh""" ,
80
+ """sed -i.bak '139i\\ '$'\\ n }\\ n' include/merlin/allocator.cuh""" ,
81
+ """sed -i.bak '140i\\ '$'\\ n void deallocate(pointer p, size_type n) {\\ n' include/merlin/allocator.cuh""" ,
82
+ """sed -i.bak '141i\\ '$'\\ n MERLIN_CHECK(\\ n' include/merlin/allocator.cuh""" ,
83
+ """sed -i.bak '142i\\ '$'\\ n allocator_ != nullptr,\\ n' include/merlin/allocator.cuh""" ,
84
+ """sed -i.bak '143i\\ '$'\\ n "[ThrustAllocator] set_allocator should be called in advance!");\\ n' include/merlin/allocator.cuh""" ,
85
+ """sed -i.bak '144i\\ '$'\\ n allocator_->free(MemoryType::Device, reinterpret_cast<void*>(p.get()));\\ n' include/merlin/allocator.cuh""" ,
86
+ """sed -i.bak '145i\\ '$'\\ n }\\ n' include/merlin/allocator.cuh""" ,
87
+ """sed -i.bak '146i\\ '$'\\ n void set_allocator(BaseAllocator* allocator) { allocator_ = allocator; }\\ n' include/merlin/allocator.cuh""" ,
88
+ """sed -i.bak '147i\\ '$'\\ n public:\\ n' include/merlin/allocator.cuh""" ,
89
+ """sed -i.bak '148i\\ '$'\\ n BaseAllocator* allocator_ = nullptr;\\ n' include/merlin/allocator.cuh""" ,
90
+ """sed -i.bak '149i\\ '$'\\ n };\\ n' include/merlin/allocator.cuh""" ,
91
+ """sed -i.bak '20i\\ '$'\\ n #include <thrust/device_malloc_allocator.h>\\ n' include/merlin/allocator.cuh""" ,
92
+ """sed -i.bak '367i\\ '$'\\ n for (auto addr : (*table)->buckets_address) {\\ n' include/merlin/core_kernels.cuh""" ,
93
+ """sed -i.bak '368i\\ '$'\\ n allocator->free(MemoryType::Device, addr);\\ n' include/merlin/core_kernels.cuh""" ,
94
+ """sed -i.bak '369i\\ '$'\\ n }\\ n' include/merlin/core_kernels.cuh""" ,
95
+ """sed -i.bak '370i\\ '$'\\ n /*\\ n' include/merlin/core_kernels.cuh""" ,
96
+ """sed -i.bak '382i\\ '$'\\ n */\\ n' include/merlin/core_kernels.cuh""" ,
97
+ """sed -i.bak '224i\\ '$'\\ n uint8_t* address = nullptr;\\ n' include/merlin/core_kernels.cuh""" ,
98
+ """sed -i.bak '225i\\ '$'\\ n allocator->alloc(MemoryType::Device, (void**)&(address), bucket_memory_size * (end - start));\\ n' include/merlin/core_kernels.cuh""" ,
99
+ """sed -i.bak '226i\\ '$'\\ n (*table)->buckets_address.push_back(address);\\ n' include/merlin/core_kernels.cuh""" ,
100
+ """sed -i.bak '228i\\ '$'\\ n allocate_bucket_others<K, V, S><<<1, 1>>>((*table)->buckets, i, address + (bucket_memory_size * (i-start)), reserve_size, bucket_max_size);\\ n' include/merlin/core_kernels.cuh""" ,
101
+ """sed -i.bak '229i\\ '$'\\ n /*\\ n' include/merlin/core_kernels.cuh""" ,
102
+ """sed -i.bak '235i\\ '$'\\ n */\\ n' include/merlin/core_kernels.cuh""" ,
103
+ """sed -i.bak '22i\\ '$'\\ n#include <vector>\\ n' include/merlin/types.cuh""" ,
104
+ """sed -i.bak '143i\\ '$'\\ n std::vector<uint8_t*> buckets_address;\\ n' include/merlin/types.cuh""" ,
105
+ ],
106
+ sha256 = "f8179c445a06a558262946cda4d8ae7252d313e73f792586be9b1bc0c993b1cf" ,
107
+ strip_prefix = "HierarchicalKV-0.1.0-beta.6" ,
108
+ url = "https://github.com/NVIDIA-Merlin/HierarchicalKV/archive/refs/tags/v0.1.0-beta.6.tar.gz" ,
109
+ )
110
+
57
111
tf_configure (
58
112
name = "local_config_tf" ,
59
113
)
0 commit comments