mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-19 02:38:09 +08:00
rebase
This commit is contained in:
62
docs/build/html/fast_8h_source.html
vendored
62
docs/build/html/fast_8h_source.html
vendored
@@ -140,7 +140,7 @@ $(function(){ initResizable(false); });
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">int</span> bits = 4,</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> s = {});</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a638c7e9b9ea8677f01786d8f9738baf8"> 50</a></span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1fast.html#aa4b5f6886b2288cb6dfdd8598579f080">affine_quantize</a>(</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a12c7ef41409d6fb378008e67b6fab328"> 50</a></span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1fast.html#a12c7ef41409d6fb378008e67b6fab328">affine_dequantize</a>(</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& w,</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& scales,</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& biases,</div>
|
||||
@@ -148,47 +148,39 @@ $(function(){ initResizable(false); });
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">int</span> bits = 4,</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> s = {});</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a12c7ef41409d6fb378008e67b6fab328"> 58</a></span><a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1fast.html#a12c7ef41409d6fb378008e67b6fab328">affine_dequantize</a>(</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& w,</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& scales,</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">const</span> <a class="code hl_class" href="classmlx_1_1core_1_1array.html">array</a>& biases,</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordtype">int</span> group_size = 64,</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">int</span> bits = 4,</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a> s = {});</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9"> 66</a></span><span class="keyword">typedef</span> std::variant<int, bool, Dtype> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9">TemplateArg</a>;</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="keyword">typedef</span> std::function<std::vector<array>(</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">const</span> std::vector<array>&,</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keyword">const</span> std::vector<std::vector<int>>&,</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">const</span> std::vector<Dtype>&,</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> std::tuple<int, int, int>,</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> std::tuple<int, int, int>,</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> std::vector<std::pair<std::string, TemplateArg>>,</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> std::optional<float>,</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">bool</span>,</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a>)></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0"> 78</a></span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">MetalKernelFunction</a>;</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#ab16436b465dc10ce472193d541d8426e"> 80</a></span><a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">MetalKernelFunction</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1fast.html#ab16436b465dc10ce472193d541d8426e">metal_kernel</a>(</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">const</span> std::string& name,</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">const</span> std::vector<std::string>& input_names,</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">const</span> std::vector<std::string>& output_names,</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keyword">const</span> std::string& source,</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="keyword">const</span> std::string& header = <span class="stringliteral">""</span>,</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordtype">bool</span> ensure_row_contiguous = <span class="keyword">true</span>,</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keywordtype">bool</span> atomic_outputs = <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>} <span class="comment">// namespace mlx::core::fast</span></div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9"> 58</a></span><span class="keyword">typedef</span> std::variant<int, bool, Dtype> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9">TemplateArg</a>;</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="keyword">typedef</span> std::function<std::vector<array>(</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">const</span> std::vector<array>&,</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">const</span> std::vector<std::vector<int>>&,</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keyword">const</span> std::vector<Dtype>&,</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> std::tuple<int, int, int>,</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> std::tuple<int, int, int>,</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> std::vector<std::pair<std::string, TemplateArg>>,</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> std::optional<float>,</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">bool</span>,</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_typedef" href="namespacemlx_1_1core.html#a95fc1013cc48fbfee0c54310711a5e58">StreamOrDevice</a>)></div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0"> 70</a></span> <a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">MetalKernelFunction</a>;</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="namespacemlx_1_1core_1_1fast.html#ab16436b465dc10ce472193d541d8426e"> 72</a></span><a class="code hl_typedef" href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">MetalKernelFunction</a> <a class="code hl_function" href="namespacemlx_1_1core_1_1fast.html#ab16436b465dc10ce472193d541d8426e">metal_kernel</a>(</div>
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keyword">const</span> std::string& name,</div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">const</span> std::vector<std::string>& input_names,</div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">const</span> std::vector<std::string>& output_names,</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keyword">const</span> std::string& source,</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keyword">const</span> std::string& header = <span class="stringliteral">""</span>,</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">bool</span> ensure_row_contiguous = <span class="keyword">true</span>,</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">bool</span> atomic_outputs = <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>} <span class="comment">// namespace mlx::core::fast</span></div>
|
||||
</div>
|
||||
<div class="ttc" id="aclassmlx_1_1core_1_1array_html"><div class="ttname"><a href="classmlx_1_1core_1_1array.html">mlx::core::array</a></div><div class="ttdef"><b>Definition</b> array.h:20</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html">mlx::core::fast</a></div><div class="ttdef"><b>Definition</b> fast.h:9</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a01bd533ebd0e2415c4ee30032d51d7bf"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a01bd533ebd0e2415c4ee30032d51d7bf">mlx::core::fast::layer_norm</a></div><div class="ttdeci">array layer_norm(const array &x, const std::optional< array > &weight, const std::optional< array > &bias, float eps, StreamOrDevice s={})</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a0e8c2c4ea7a946568c8fe5b4810417e0"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">mlx::core::fast::MetalKernelFunction</a></div><div class="ttdeci">std::function< std::vector< array >(const std::vector< array > &, const std::vector< std::vector< int > > &, const std::vector< Dtype > &, std::tuple< int, int, int >, std::tuple< int, int, int >, std::vector< std::pair< std::string, TemplateArg > >, std::optional< float >, bool, StreamOrDevice)> MetalKernelFunction</div><div class="ttdef"><b>Definition</b> fast.h:78</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a0e8c2c4ea7a946568c8fe5b4810417e0"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a0e8c2c4ea7a946568c8fe5b4810417e0">mlx::core::fast::MetalKernelFunction</a></div><div class="ttdeci">std::function< std::vector< array >(const std::vector< array > &, const std::vector< std::vector< int > > &, const std::vector< Dtype > &, std::tuple< int, int, int >, std::tuple< int, int, int >, std::vector< std::pair< std::string, TemplateArg > >, std::optional< float >, bool, StreamOrDevice)> MetalKernelFunction</div><div class="ttdef"><b>Definition</b> fast.h:70</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a12c7ef41409d6fb378008e67b6fab328"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a12c7ef41409d6fb378008e67b6fab328">mlx::core::fast::affine_dequantize</a></div><div class="ttdeci">array affine_dequantize(const array &w, const array &scales, const array &biases, int group_size=64, int bits=4, StreamOrDevice s={})</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a3663b50265b0a9c0cca2b5376852e059"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a3663b50265b0a9c0cca2b5376852e059">mlx::core::fast::scaled_dot_product_attention</a></div><div class="ttdeci">array scaled_dot_product_attention(const array &queries, const array &keys, const array &values, const float scale, const std::optional< array > &mask=std::nullopt, const std::optional< int > memory_efficient_threshold=std::nullopt, StreamOrDevice s={})</div><div class="ttdoc">Computes: O = softmax(Q @ K.T) @ V.</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a534ef357eae24892684a6ecd866d3fab"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a534ef357eae24892684a6ecd866d3fab">mlx::core::fast::rope</a></div><div class="ttdeci">array rope(const array &x, int dims, bool traditional, std::optional< float > base, float scale, int offset, const std::optional< array > &freqs=std::nullopt, StreamOrDevice s={})</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a9390693ff7be931f3ef3428e2ea4c3f9"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9">mlx::core::fast::TemplateArg</a></div><div class="ttdeci">std::variant< int, bool, Dtype > TemplateArg</div><div class="ttdef"><b>Definition</b> fast.h:66</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_a9390693ff7be931f3ef3428e2ea4c3f9"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#a9390693ff7be931f3ef3428e2ea4c3f9">mlx::core::fast::TemplateArg</a></div><div class="ttdeci">std::variant< int, bool, Dtype > TemplateArg</div><div class="ttdef"><b>Definition</b> fast.h:58</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_aa4b5f6886b2288cb6dfdd8598579f080"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#aa4b5f6886b2288cb6dfdd8598579f080">mlx::core::fast::affine_quantize</a></div><div class="ttdeci">std::tuple< array, array, array > affine_quantize(const array &w, int group_size=64, int bits=4, StreamOrDevice s={})</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_ab16436b465dc10ce472193d541d8426e"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#ab16436b465dc10ce472193d541d8426e">mlx::core::fast::metal_kernel</a></div><div class="ttdeci">MetalKernelFunction metal_kernel(const std::string &name, const std::vector< std::string > &input_names, const std::vector< std::string > &output_names, const std::string &source, const std::string &header="", bool ensure_row_contiguous=true, bool atomic_outputs=false)</div></div>
|
||||
<div class="ttc" id="anamespacemlx_1_1core_1_1fast_html_ac7b620275c6386f822b7aacc6b312e62"><div class="ttname"><a href="namespacemlx_1_1core_1_1fast.html#ac7b620275c6386f822b7aacc6b312e62">mlx::core::fast::rms_norm</a></div><div class="ttdeci">array rms_norm(const array &x, const array &weight, float eps, StreamOrDevice s={})</div></div>
|
||||
|
Reference in New Issue
Block a user