Skip to content

Commit

Permalink
Update computation setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankya2 committed Feb 2, 2024
1 parent 347cb35 commit bc48702
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import numpy as np
from qibo import Circuit, gates
import qibo

# Below shows 3 ways of setting the computation_settings
# Below shows how to set the computation_settings
# Note that for MPS_enabled and expectation_enabled parameters the accepted inputs are boolean or a dictionary with the format shown below.
# If computation_settings is not specified, the default setting is used in which all booleans will be False.
# This will trigger the dense vector computation of the tensornet.

computation_settings = {
'MPI_enabled': False,
'MPS_enabled': {
"qr_method": False,
Expand All @@ -41,20 +42,6 @@ import qibo
'expectation_enabled': False
}

# computation_settings = {
# 'MPI_enabled': False,
# 'MPS_enabled': False,
# 'NCCL_enabled': False,
# 'expectation_enabled': {
# 'pauli_string_pattern': "IXZ"
# }

# computation_settings = {
# 'MPI_enabled': False,
# 'MPS_enabled': True,
# 'NCCL_enabled': False,
# 'expectation_enabled': False
# }

qibo.set_backend(backend="qibotn", runcard=computation_settings)

Expand All @@ -70,6 +57,27 @@ result = c()
print(result.state())
```

Other examples of setting the computation_settings

```py
# Expectation computation with specific Pauli String pattern
computation_settings = {
'MPI_enabled': False,
'MPS_enabled': False,
'NCCL_enabled': False,
'expectation_enabled': {
'pauli_string_pattern': "IXZ"
}

# Dense vector computation using multi node through MPI
computation_settings = {
'MPI_enabled': False,
'MPS_enabled': True,
'NCCL_enabled': False,
'expectation_enabled': False
}
```

## Multi-Node
Multi-node is enabled by setting either the MPI or NCCL enabled flag to True in the computation settings. Below shows the script to launch on 2 nodes with 2 GPUs each. $node_list contains the IP of the nodes assigned.

Expand Down

0 comments on commit bc48702

Please sign in to comment.