-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
159 lines (157 loc) · 10.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pascal: Pascal: Hardware-Enhanced Bayesian Learning</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Pascal
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div><div class="header">
<div class="headertitle"><div class="title">Pascal: Hardware-Enhanced Bayesian Learning </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md_README"></a> Pascal is a software framework written in C that enables hardware-enhanced Bayesian Learning. It contains modules that can carry out operations on tensors, similar to <a href="https://numpy.org/doc/stable/reference/generated/numpy.array.html">NumPy Arrays</a>, <a href="https://pytorch.org/docs/stable/tensors.html">PyTorch Tensors</a>, and other popular tools. Pascal can also carry out reverse-mode automatic differentiation using the <code>pascal-autodiff</code> module.</p>
<h1><a class="anchor" id="autotoc_md1"></a>
Requirements</h1>
<p >Pascal can run using several backends. By default, Pascal uses <code>clapack</code>, which is included in this repository. Therefore you do not have to</p>
<p >Pascal uses either a <code>cblas</code> or a <code>libgsl</code> backend to carry out some operations. Thus, these should be installed. The [Makefile](Makefile) includes flags that should point to standard locations. If these don't work, please updated the <code>INCLUDE_FLAGS</code>, <code>LDFLAGS</code> and <code>FRAMEWORK_FLAGS</code> variables in the <code>configs/default.conf</code> as needed. Alternatively, you can create a new configuration file (<code>.conf</code>) in the <code>configs</code> folder and update the <code>CONFIGURATION</code> variable in the <code>Makefile</code> (note that if your new configuration is <code>configs/new-config.conf</code>, <code>CONFIGURATION</code> should be set to <code>new-config</code>).</p>
<h2><a class="anchor" id="autotoc_md2"></a>
CBLAS and GSL on MacOS</h2>
<p >On MacOS, these are included in the <a href="https://developer.apple.com/documentation/accelerate">Accelerate framework</a>. This is installed with the XCode command-line tools, by running: </p><div class="fragment"><div class="line">xcode-select --install</div>
</div><!-- fragment --><p >Currently, <code>default.conf</code> assumes that <code>libgsl</code> is installed using <a href="https://brew.sh"><code>homebrew</code></a> by running: </p><div class="fragment"><div class="line">brew install gsl</div>
</div><!-- fragment --><p >If you install it using other means, please update the <code>INCLUDE_FLAGS</code> and <code>LDFLAGS</code> in the correct if-else block.</p>
<h2><a class="anchor" id="autotoc_md3"></a>
CBLAS and GSL on Linux</h2>
<p >To be written</p>
<h1><a class="anchor" id="autotoc_md4"></a>
Build</h1>
<p >To use this package, simply clone this repository. This can be done as: </p><div class="fragment"><div class="line">git clone --recursive https://github.com/physical-computation/pascal.git</div>
</div><!-- fragment --><blockquote class="doxtable">
<p >‍[!NOTE] The <code>--recursive</code> is important since this repository uses submodules. </p>
</blockquote>
<p >Then you can build it using </p><div class="fragment"><div class="line">make</div>
</div><!-- fragment --><p >This creates a library file in <code>libs/</code></p>
<p >To test, run: </p><div class="fragment"><div class="line">make test</div>
</div><!-- fragment --><p >If everything worked well, this will print: </p><div class="fragment"><div class="line">tests/load_data/test; tests/tensor_integration/test; tests/tensor/test; tests/tensor_random_sample/test; tests/tensor_utils/test; tests/autodiff/test; tests/autodiff_primitives/test; tests/tensor_broadcast/test; tests/tensor_iterate/test;</div>
<div class="line">Running tests in load_data:</div>
<div class="line">Completed: 3/3 passed in 596µs</div>
<div class="line">Running tests in pascal_tensor_integrations:</div>
<div class="line">Completed: 15/15 passed in 192µs</div>
<div class="line">Running tests in tensor:</div>
<div class="line">Completed: 48/48 passed in 372µs</div>
<div class="line">Running tests in pascal_tensor_random_sample:</div>
<div class="line">Completed: 2/2 passed in 3µs</div>
<div class="line">Running tests in pascal_tensor_utils:</div>
<div class="line">Completed: 8/8 passed in 10µs</div>
<div class="line">Running tests in autodiff:</div>
<div class="line">Completed: 15/15 passed in 273µs</div>
<div class="line">Running tests in autodiff_primitives:</div>
<div class="line">Completed: 19/19 passed in 106µs</div>
<div class="line">Running tests in pascal_tensor_broadcast:</div>
<div class="line">Completed: 3/3 passed in 12µs</div>
<div class="line">Running tests in pascal_tensor_iterate:</div>
<div class="line">Completed: 6/6 passed in 8µs</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md5"></a>
Examples and Benchmarks</h1>
<blockquote class="doxtable">
<p >‍[!NOTE] Currently, the Makefiles in <code>examples/</code> and <code>benchmarks/</code> are written to work with <code>macOS</code> only. </p>
</blockquote>
<p>A basic implementation of a tensor operation using <code>Pascal</code> is</p>
<p >The examples and benchmarks use Python to run some analyses and baselines. It is recommended that you use a virtual environment. Install the required packages using </p><div class="fragment"><div class="line">pip install -r requirements.txt</div>
</div><!-- fragment --><p> Please see the <code>examples/</code> folder. It includes a few simple examples of using the functionality that Pascal offers. The <code>Makefile</code>s for</p>
<h2><a class="anchor" id="autotoc_md6"></a>
Running examples</h2>
<p >All examples can be executed by running the following from the root directory of this project: </p><div class="fragment"><div class="line">make examples</div>
</div><!-- fragment --><p >Individual examples can be executed using the following syntax: </p><div class="fragment"><div class="line">make eg-<example></div>
</div><!-- fragment --><p> <code><example></code> can be replaced by the names of the folders inside of <code>examples/</code>, such as <code>nn-simple</code> and <code>bnn-simple</code>.</p>
<h2><a class="anchor" id="autotoc_md7"></a>
Running benchmarks</h2>
<p >We currently compare some of our tensor operations against <a href="www.numpy.org"><code>NumPy</code></a>. To run these benchmarks, run </p><div class="fragment"><div class="line">make benchmarks</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md8"></a>
Documentation</h1>
<p >There is a set of incomplete documentation in <code>docs/</code>. Furthermore, documentation comments can be found on some of the function in <code><a class="el" href="pascal_8h.html">include/pascal.h</a></code>. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3 </li>
</ul>
</div>
</body>
</html>