You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sphinx/source/introduction/ad.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,10 +41,10 @@ Advanced anomaly analysis
41
41
~~~~~~~~~~~~~~~~~~~~~~~~~
42
42
1. Histogram Based Outlier Score (HBOS) is a deterministic and non-parametric statistical anomaly detection algorithm. It is implemented as part of Chimbuko's anomaly analysis module. HBOS is an unsupervised anomaly detection algorithm which scores data in linear time. It supports dynamic bin widths which ensures long-tail distributions of function executions are captured and global anomalies are detected better. HBOS normalizes the histogram and calculates the anomaly scores by taking inverse of estimated densities of function executions. The score is a multiplication of the inverse of the estimated densities given by the following Equation
43
43
44
-
.. math::
45
-
HBOS_{i} = \log_{2} (1 / density_{i})
44
+
.. math::
45
+
HBOS_{i} = \log_{2} (1 / density_{i} + \alpha)
46
46
47
-
where :math:`i` is a function execution and :math:`density_{i}` is function execution probability. HBOS works in :math:`O(nlogn)` using dynamic bin-width or in linear time :math:`O(n)` using fixed bin width. After scoring, the top 1% of scores are filtered as anomalous function executions. This filter value can be set at runtime to adjust the density of detected anomalies.
47
+
where :math:`i` is the index of a particular a function execution and :math:`density_{i}` is function execution probability. The offset :math:`\alpha` is chosen such that the scores lie in the range :math:`0\to100`. HBOS works in :math:`O(nlogn)` using dynamic bin-width or in linear time :math:`O(n)` using fixed bin width. After scoring, the top 1% of scores are filtered as anomalous function executions. This filter value can be set at runtime to adjust the density of detected anomalies.
48
48
49
49
2. Another algorithm is added into Chimbuko's advanced anomaly analysis called the COPula based Outlier Detection (COPOD), which is a deterministic, parameter-free anomaly detection algorithm. It computes empirical copulas for each sample in the dataset. A copula defines the dependence structure between random variables. For each sample in the dataset, COPOD algorithm computes left-tail empirical copula from left-tail empirical cumulative distribution function, right-tail copula from right-tail empirical cumulative distribution function, and a skewness-corrected empirical copula using a skewness coefficient calculated from left-tail and right-tail empirical cumulative distribution functions. These three computed values are interpreted as left-tail, right-tail, and skewness-corrected probabilities, respectively. Lowest probability value results in largest negative-log value, which is the score assigned to the sample in the dataset. Samples with the highest scores in the dataset are tagged as anomalous.
Copy file name to clipboardExpand all lines: sphinx/source/introduction/provdb.rst
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,13 @@
2
2
Provenance Database
3
3
*******************
4
4
5
-
The role of the provenance database is three-fold:
5
+
The role of the provenance database is four-fold:
6
6
7
7
- To store detailed information about anomalous function executions and also, for comparison, samples of normal executions. Stored in the **anomaly database**.
8
8
- To store a wealth of metadata regarding the characteristics of the devices upon which the application is running. Stored in the **anomaly database**.
9
9
- To store globally-aggregated function profile data and counter averages that reflect the overall running of the application. Stored in the **global database**.
10
-
10
+
- To store the final AD model for each function. Stored in the **global database**.
11
+
11
12
The databases are implemented using `Sonata <https://xgitlab.cels.anl.gov/sds/sonata>`_ which implements a remote database built on top of `UnQLite <https://unqlite.org/>`_, a server-less JSON document store database. Sonata is capable of furnishing many clients and allows for arbitrarily complex document retrieval via `jx9 queries <https://unqlite.org/jx9.html>`_.
12
13
13
14
In order to improve parallelizability the **anomaly database**, which stores the provenance data and metadata collected from the AD instances, is sharded (split over multiple independent instances), with the AD instances assigned to a shared in a round-robin fashion based on their rank index. The database shared are organized into three *collections*:
@@ -20,6 +21,7 @@ The **global database** exists as a single shard, and is written to at the very
20
21
21
22
* **func_stats** : function profile information including statistics (mean, std. dev., etc) on the inclusive and exclusive runtimes as well as the number and frequency of anomalues.
22
23
* **counter_stats** : averages of various counters collected over the run.
24
+
* **ad_model** : the final AD model for each function.
23
25
24
26
The schemata for the contents of both database components are described here: :ref:`io_schema/provdb_schema:Provenance Database Schema`
Copy file name to clipboardExpand all lines: sphinx/source/introduction/ps.rst
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,8 +19,9 @@ Design
19
19
20
20
(**C**)lients (i.e. on-node AD modules) send requests with their locally-computed anomaly detection algorithm parameters to be aggregated with the global parameters and the updated parameters returned to the client. Network communication is performed using the `ZeroMQ <https://zeromq.org>`_ library and using `Cereal <https://uscilab.github.io/cereal/>`_ for data serialization.
21
21
22
-
For handling requests from a large number of connected clients the parameter server uses a ROUTER-DEALER pattern whereby requests are sent to a **Frontend** router and distributed over thread (**W**)orkers
23
-
via the **Backend** router in round-robin fashion. For the task of updating parameters, workers first acquire a global lock, and update the **in-mem DB**, and return the updated parameters (cf. :ref:`api/api_code:SstdParam`). Global statistics on anomalies and counters are compiled in a similar way using the data sent from the AD instances (cf. `global_anomaly_stats <../api/api_code.html#global-anomaly-stats>`__ and `global_counter_stats <../api/api_code.html#global-counter-stats>`__) and also stored in this database.
22
+
For handling requests from a large number of connected clients the parameter server uses a ROUTER-DEALER pattern whereby requests are sent to a **Frontend** router and distributed over thread (**W**)orkers via the **Backend** router in round-robin fashion.
23
+
24
+
For the task of updating parameters, scalability is ensured by having each worker write to a separate parameter object in the **In-Mem DB**. These are periodically aggregated by a background thread and the global model updated, typically once per second such that the AD instances receive the most up-to-date model as possible. Global statistics on anomalies and counters are compiled in a similar way using the data sent from the AD instances (cf. `global_anomaly_stats <../api/api_code.html#global-anomaly-stats>`__ and `global_counter_stats <../api/api_code.html#global-counter-stats>`__) and also stored in this database.
24
25
25
26
A dedicated (**S**)treaming thread (cf. :ref:`api/api_code:PSstatSender`) is maintained that periodically sends the latest global statistics to the visualization server.
Copy file name to clipboardExpand all lines: sphinx/source/io_schema/provdb_schema.rst
+22-4Lines changed: 22 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Provenance Database Schema
5
5
Main database
6
6
-------------
7
7
8
-
Below we describe the JSON schema for the **anomalies**and **normalexecs** collections of the **main database** component of the provenance database.
8
+
Below we describe the JSON schema for the **anomalies**, **normalexecs** and **metadata** collections of the **main database** component of the provenance database.
9
9
10
10
Function event schema
11
11
^^^^^^^^^^^^^^^^^^^^^
@@ -114,8 +114,12 @@ For the SSTD (original) algorithm, the **algo_params** field has the following f
114
114
For the HBOS and COPOD algorithms, the **algo_params** field has the following format:
115
115
116
116
|{
117
-
|**"Histogram Bin Counts"** : *the height of the histogram bin*,
118
-
|**"Histogram Bin Edges"** : *the edges of the bins starting with the lower edge of bin 0 followed by the upper edges of bins 0..N*
117
+
|**"histogram"**: *the histogram*,
118
+
|{
119
+
|**"Histogram Bin Counts"** : *the height of the histogram bin (array)* ,
120
+
|**"Histogram Bin Edges"** : *the edges of the bins starting with the lower edge of bin 0 followed by the upper edges of bins 0..N (array)*
121
+
|},
122
+
|**"internal_global_threshold"** : *a score threshold for anomaly detection used internally*
119
123
|}
120
124
121
125
@@ -180,7 +184,7 @@ Note that the **tid** (thread index) for metadata is usually 0, apart from for m
180
184
Global database
181
185
---------------
182
186
183
-
Below we describe the JSON schema for the **func_stats**and **counter_stats** collections of the **global database** component of the provenance database.
187
+
Below we describe the JSON schema for the **func_stats**, **counter_stats** and **ad_model** collections of the **global database** component of the provenance database.
184
188
185
189
Function profile statistics schema
186
190
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -247,3 +251,17 @@ The **counter_stats** collection has the following schema:
247
251
|}
248
252
|}
249
253
254
+
AD model schema
255
+
^^^^^^^^^^^^^^^^^^^^^^^^^
256
+
257
+
The **ad_model** collection contains the final AD model for each function. It has the following schema:
258
+
259
+
|{
260
+
|**"__id"**: *A unique record index*,
261
+
|**"pid"**: *The program index*,
262
+
|**"fid"**: *The function index*,
263
+
|**"func_name"**: *The function name*,
264
+
|**"model"** : *The model for this function, form dependent on algorithm used (object)*
265
+
|}
266
+
267
+
The **"model"** entry has the same form as the **"algo_params"** entry of the main database, and is documented above.
0 commit comments