Skip to content

Commit 2036a2c

Browse files
Sam ParteeEric Gustin
Sam Partee
and
Eric Gustin
authored
Fix Typos in Documentation from Eric
Co-authored-by: Eric Gustin <[email protected]>
1 parent 1c7f8ec commit 2036a2c

File tree

4 files changed

+32
-34
lines changed

4 files changed

+32
-34
lines changed

CITATION.cff

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ authors:
1313
- family-names: Bachman
1414
given-names: Scott
1515
orcid: https://orcid.org/0000-0002-6479-4300
16-
- family-names: Gustavo
17-
given-names: Marques
16+
- family-names: Marques
17+
given-names: Gustavo
1818
orcid: https://orcid.org/0000-0001-7238-0290
19-
- family-names: Andrew
20-
given-names: Shao
19+
- family-names: Shao
20+
given-names: Andrew
2121
orcid: https://orcid.org/0000-0003-3658-512X
2222
- family-names: Benjamin
2323
given-names: Robbins
2424
orcid: https://orcid.org/0000-0003-3658-512X
2525

26-
title: "Using Machine Learning at Scale in HPCSimulations with SmartSim: An Application to Ocean Climate Modeling"
26+
title: "Using Machine Learning at Scale in HPC Simulations with SmartSim: An Application to Ocean Climate Modeling"
2727
doi: 10.5281/zenodo.4682270
2828
date-released: 2021-4-12
29-
license: "BSD-2-Clause"
29+
license: "BSD-2-Clause"

doc/tutorials/inference.rst

+12-13
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Online Inference
55

66
Compiling TensorFlow or PyTorch runtimes into each existing simulation is
77
difficult. Maintaining that type of integration with the rapidly growing and changing
8-
APIs of libaries like TensorFlow and PyTorch is even more difficult.
8+
APIs of libraries like TensorFlow and PyTorch is even more difficult.
99

1010
Instead of forcing dependencies on the simulation code, SmartSim itself maintains those dependencies
1111
and provides them in the ``Orchestrator`` database through RedisAI.
1212

13-
Because of this, Simulations in Fortran, C, C++ and Python can call into PyTorch, TensorFlow,
13+
Because of this, simulations in Fortran, C, C++ and Python can call into PyTorch, TensorFlow,
1414
and any library that supports the ONNX format without having to compile in those libraries.
1515

1616
Therefore we define *Online Inference* as the execution of machine learning models via
17-
requests to an application (Orchestrator) running seperately from the client program (Simulation)
17+
requests to an application (Orchestrator) running separately from the client program (Simulation)
1818
without exchanging data over the filesystem.
1919

2020

@@ -51,10 +51,10 @@ script that uses the SmartRedis Python client to perform innovations of the ML r
5151
The above script will first launch the database, and then the script
5252
containing the SmartRedis client code Python script. The code here could
5353
easily be adapted to launch a C, C++, or Fortran application containing
54-
the SmartRedis clients in those langugages as well.
54+
the SmartRedis clients in those languages as well.
5555

5656
Below are a few examples of scripts that could be used with the above
57-
code to perform online inference in with various ML backends supported
57+
code to perform online inference with various ML backends supported
5858
by SmartSim.
5959

6060

@@ -71,7 +71,7 @@ by SmartSim.
7171
.. _trace: https://pytorch.org/docs/stable/generated/torch.jit.trace.html#torch.jit.trace
7272

7373
The Orchestrator supports both `PyTorch`_ models and `TorchScript`_ functions and scripts
74-
in `PyTorch`_ 1.7.1. To use onnx in SmartSim, specify
74+
in `PyTorch`_ 1.7.1. To use ONNX in SmartSim, specify
7575
``TORCH`` as the argument for *backend* in the call to ``client.set_model`` or
7676
``client.set_model_from_file``.
7777

@@ -135,7 +135,7 @@ Torch documentation for `trace`_.
135135
torch.jit.save(module, model_buffer)
136136
return model_buffer.getvalue()
137137
138-
Lastly, we use the SmartRedis Python client to connect to
138+
Lastly, we use the SmartRedis Python client to
139139
1. Connect to the database
140140
2. Put a batch of 20 tensors into the database (``put_tensor``)
141141
3. Set the Torch model in the database (``set_model``)
@@ -185,7 +185,7 @@ SmartSim include a utility to freeze the graph of a TensorFlow or Keras model in
185185
``TF`` as the argument for *backend* in the call to ``client.set_model`` or
186186
``client.set_model_from_file``.
187187

188-
The example below shows how to use the utility to freeze an mnist model created in
188+
The example below shows how to use the utility to freeze an MNIST model created in
189189
Keras. This script can be used with the :ref:`SmartSim code <infrastructure_code>`
190190
above to launch an inference session with a TensorFlow or Keras model.
191191

@@ -221,9 +221,9 @@ method ``client.set_model_from_file`` can load it into the database.
221221

222222
Note that TensorFlow and Keras, unlike the other ML libraries supported by
223223
SmartSim, requires an ``input`` and ``output`` argument in the call to
224-
``set_model``. These arguments correspond the the layer names of the
224+
``set_model``. These arguments correspond to the layer names of the
225225
created model. The ``smartsim.tf.freeze_model`` utility returns these
226-
values for convienence as shown below.
226+
values for convenience as shown below.
227227

228228
.. code-block:: python
229229
@@ -287,7 +287,7 @@ models to ONNX.
287287
And PyTorch has it's own converter.
288288

289289
Below are some examples of a few models in `Scikit-learn`_ that are converted
290-
into onnx format for use with SmartSim. To use onnx in SmartSim, specify
290+
into ONNX format for use with SmartSim. To use ONNX in SmartSim, specify
291291
``ONNX`` as the argument for *backend* in the call to ``client.set_model`` or
292292
``client.set_model_from_file``.
293293

@@ -327,7 +327,7 @@ with two ``outputs``.
327327
Random Forest
328328
-------------
329329

330-
The Random Forest example uses the Iris datset from Scikit Learn to train a
330+
The Random Forest example uses the Iris dataset from Scikit Learn to train a
331331
RandomForestRegressor. As with the other examples, the skl2onnx function
332332
`skl2onnx.to_onnx`_ is used to convert the model to ONNX format.
333333

@@ -348,4 +348,3 @@ RandomForestRegressor. As with the other examples, the skl2onnx function
348348
client.set_model("rf_regressor", model, "ONNX", device="CPU")
349349
client.run_model("rf_regressor", inputs="input", outputs="output")
350350
print(client.get_tensor("output"))
351-

doc/tutorials/lattice_boltz_analysis.rst

+13-14
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Online Analysis
55
Being able to visualize and interpret simulation data in real time is
66
invaluable for understanding the behavior of a physical system.
77

8-
SmartSim can be used to stream data from and Fortran, C, C++ simulations
9-
to Python where visualization is signifigantly easier and more interactive.
8+
SmartSim can be used to stream data from Fortran, C, and C++ simulations
9+
to Python where visualization is significantly easier and more interactive.
1010

1111
3.1 Lattice Boltzmann Simulation
1212
--------------------------------
@@ -33,14 +33,14 @@ Philip also wrote a great medium `article`_ explaining the simulation in detail.
3333
.. _Dataset: https://www.craylabs.org/docs/sr_data_structures.html#dataset
3434

3535
Typically HPC simulations are written in C, C++, Fortran or other high performance
36-
languages. Embedding the SmartRedis client usually invovles compiling in the
36+
languages. Embedding the SmartRedis client usually involves compiling in the
3737
SmartRedis library into the simulation.
3838

3939
Because this simulation is written in Python, we can use the SmartRedis
4040
Python client to stream data to the database.
4141

4242
To make the visualization easier, we use the SmartRedis `Dataset`_ object
43-
to hold two 2D NumPy arrays. A convience function is provided to convert
43+
to hold two 2D NumPy arrays. A convenience function is provided to convert
4444
the fields into a dataset object.
4545

4646

@@ -67,7 +67,7 @@ the fields into a dataset object.
6767
return dataset
6868
6969
This is all the SmartRedis code needed to stream the simulation data. Note that
70-
the client does not need to have an address explictly stated because we
70+
the client does not need to have an address explicitly stated because we
7171
are going to be launching the simulation through SmartSim.
7272

7373
The full simulation code can be found here # PUT IN LINK
@@ -77,12 +77,12 @@ The full simulation code can be found here # PUT IN LINK
7777

7878

7979
SmartSim, the infrastructure library, is used here to launch both the
80-
database and the simulation locally, but in seperate processes. The example
80+
database and the simulation locally, but in separate processes. The example
8181
is designed to run on laptops, so the local launcher is used.
8282

8383

84-
First the necessary libraries are imported and and `Experiment` instance is created.
85-
Also defined is an `Orchestrator` which is the refrence to the in-memory database
84+
First the necessary libraries are imported and an `Experiment` instance is created.
85+
Also defined is an `Orchestrator` which is the reference to the in-memory database
8686
to be launched and used to stage data between the simulation and analysis code.
8787

8888
.. code-block:: python
@@ -102,7 +102,7 @@ The reference to the simulation is created through a call to `Experiment.create_
102102
The python script is "attached" to the model, such that when run directories are
103103
created for it, the python script will be placed in that run directory.
104104

105-
Executable arguments are used to pass the simulation parameters to the to simulation.
105+
Executable arguments are used to pass the simulation parameters to the simulation.
106106

107107
.. code-block:: python
108108
@@ -136,20 +136,20 @@ being streamed from the simulation can be analyzed in real time.
136136
exp.start(db)
137137
client = Client(address="127.0.0.1:6780", cluster=False)
138138
139-
# start simulation without blocking so data can be analyized in real time
139+
# start simulation without blocking so data can be analyzed in real time
140140
exp.start(model, block=False, summary=True)
141141
142142
143-
SmartRedis is used to pull the Datasets created by
143+
SmartRedis is used to pull the Datasets created by
144144
the simulation and use matplotlib to plot the results.
145145

146146
Another `Model` could have been created to plot the results and launched
147147
in a similar manner to the simulation.
148148

149149
Doing so would enable the analysis application to be executed on different
150-
resources such as GPU enabled nodes, or distributed accross nodes.
150+
resources such as GPU enabled nodes, or distributed across nodes.
151151

152-
This version, where the driver and anaylsis code coexist in the same
152+
This version, where the driver and analysis code coexist in the same
153153
script, is shown for simplicity.
154154

155155
.. code-block:: python
@@ -231,4 +231,3 @@ online analysis example
231231
└── fv_simulation.out
232232
233233
2 directories, 6 files
234-

tutorials/03_online_analysis/lattice/driver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
exp.start(db)
3131
client = Client(address="127.0.0.1:6780", cluster=False)
3232

33-
# start simulation without blocking so data can be analyized in real time
33+
# start simulation without blocking so data can be analyzed in real time
3434
exp.start(model, block=False, summary=True)
3535

3636
# poll until data is available

0 commit comments

Comments
 (0)