Commit 9a784a4c by ZhangLingbo

update for alphazero-general/pk, using zmq, tested ok!

parent 2b12bc82
No preview for this file type
......@@ -13,7 +13,8 @@ def main():
assert(mlu_id < 4 and mlu_id >= 0)
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect('tcp://10.34.134.204:1238')
# socket.connect('tcp://10.34.134.204:1238')
socket.connect('tcp://10.37.199.62:1238')
socket.send('')
while True:
task = socket.recv().split('-')
......
......@@ -178,6 +178,8 @@ def play(total_game):
if m == '':
continue
black, white, bwin = m.split('-')
if bwin == "nan":
continue
elo.playgame(black, white, float(bwin))
complete_game += 1
sys.stdout.write('{}/{} games completed, taking {:.1f}s\r'.format(complete_game, total_game, time.time() - tstart))
......
......@@ -4,38 +4,23 @@ import time
import os
import commands as cmd
pj_dir = "/share/2_sxk_mlu_alphago_"
data_dir = "/share/data_sxk"
model_dir = "/share/elo-rating/models/"
def get_cmd(num_games, mlu, model1, model2, rollout, c_puct, rollouts0 = '-1', rollouts1 = '-1'):
def get_cmd(num_games, mlu, model1, model2):
cmd_str = ""
cmd_str += "%s " % (os.path.join(pj_dir, "build", "pk"))
cmd_str += "/share/alphazero-general/build/pk "
cmd_str += "--eval_game_num %d " %(num_games)
cmd_str += "--mlu_list_0 %d "%(mlu)
cmd_str += "--mlu_list_1 %d "%(mlu)
cmd_str += "--config_path_0 %s "%(os.path.join('/share/elo-rating', "etc", "9_pk_offline_1.4.0.conf"))
cmd_str += "--config_path_1 %s "%(os.path.join('/share/elo-rating', "etc", "9_pk_offline_1.4.0.conf"))
cmd_str += "--device_id %d "%(mlu)
cmd_str += "--device_num 1 "
cmd_str += "--config_path_p1_mcts /share/alphazero-general/go9/etc/pk_p1_mcts.conf "
cmd_str += "--config_path_p1_eval /share/alphazero-general/go9/etc/pk_p1_eval.conf "
cmd_str += "--config_path_p2_mcts /share/alphazero-general/go9/etc/pk_p2_mcts.conf "
cmd_str += "--config_path_p2_eval /share/alphazero-general/go9/etc/pk_p2_eval.conf "
cmd_str += "--model_path_0 %s "%(model1)
cmd_str += "--model_path_1 %s "%(model2)
cmd_str += "--rollout_0 %d "%(rollout)
cmd_str += "--rollout_1 %d "%(rollout)
cmd_str += "--rollouts_0 %s "%(rollouts0)
cmd_str += "--rollouts_1 %s "%(rollouts1)
cmd_str += "--c_puct_0 %f "%(c_puct)
cmd_str += "--c_puct_1 %f "%(c_puct)
# TODO: check this
# cmd_str += "--result_path %s "%("-1")
return cmd_str
def pk(model1, model2, num_games = 1, mlu_id = 0, rollouts1='-1', rollouts2 = '-1'):
rollout = 200
if rollouts1 != '-1':
assert(rollouts2 != '-1')
rollout = -1
c_puct = 1.5
model1 = model_dir + model1
model2 = model_dir + model2
cmd_str = get_cmd(num_games, mlu_id, model1, model2, rollout, c_puct, rollouts1, rollouts2)
cmd_str = get_cmd(num_games, mlu_id, model1, model2)
s, o = cmd.getstatusoutput(cmd_str)
# os.system(cmd_str)
if (s != 0):
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
model rating games wins losses
test82_88000 2092.96 1114 680 434
test82_98000 2092.87 1048 671 377
test82_92000 2091.46 1125 686 439
test81_98000 2073.02 1130 713 417
test81_96000 2072.83 1137 686 451
test82_94000 2068.49 1123 699 424
test79_82000 2046.88 1202 645 557
test82_74000 2045.64 1197 708 489
test81_90000 2045.44 1202 736 466
test81_68000 2040.16 1208 696 512
test82_64000 2038.93 1177 650 527
test81_76000 2038.80 1164 685 479
test108_80000 2038.79 1264 709 555
test82_78000 2038.50 1148 703 445
test81_78000 2037.05 1189 695 494
test79_86000 2022.56 1254 654 600
test108_96000 2021.20 1206 676 530
test82_76000 2020.45 1177 702 475
test108_94000 2019.68 1205 712 493
test108_90000 2019.15 1171 669 502
test81_60000 2008.40 1249 663 586
test82_68000 2007.81 1203 690 513
test82_62000 2004.01 1114 645 469
test82_70000 2003.80 1197 702 495
test82_84000 2001.68 1119 680 439
test81_94000 2000.13 1085 665 420
test108_78000 1999.74 1203 684 519
test82_86000 1995.31 1120 669 451
test82_96000 1994.75 1097 685 412
test108_76000 1994.45 1176 664 512
test82_72000 1992.08 1132 670 462
test79_94000 1988.47 1111 646 465
test82_82000 1986.26 1207 704 503
test108_62000 1983.83 1229 652 577
test108_68000 1983.80 1236 668 568
test79_98000 1981.57 1193 697 496
test82_80000 1979.79 1209 700 509
test81_66000 1977.91 1243 671 572
test108_72000 1970.62 1169 675 494
test81_84000 1970.61 1128 689 439
test108_98000 1968.43 1157 650 507
test74_98000 1963.09 1292 668 624
test81_82000 1957.27 1100 662 438
test81_72000 1955.99 1192 643 549
test82_90000 1955.95 1134 692 442
test82_60000 1955.72 1268 686 582
test81_92000 1955.08 1114 687 427
test82_48000 1954.43 1291 645 646
test79_88000 1948.61 1239 679 560
test108_86000 1947.12 1172 657 515
test108_58000 1941.02 1246 638 608
test81_88000 1938.64 1105 676 429
test74_92000 1934.87 1250 634 616
test79_96000 1934.71 1186 676 510
test81_74000 1932.83 1192 678 514
test108_84000 1932.39 1162 654 508
test79_76000 1931.75 1250 655 595
test108_60000 1929.63 1234 649 585
test82_52000 1927.74 1256 645 611
test79_90000 1925.35 1213 677 536
test82_58000 1925.15 1238 624 614
test108_56000 1922.93 1265 663 602
test108_54000 1922.57 1262 618 644
test81_62000 1920.67 1166 636 530
test79_92000 1920.19 1145 642 503
test82_50000 1917.63 1240 599 641
test79_78000 1915.69 1241 646 595
test81_80000 1915.56 1224 703 521
test108_88000 1915.03 1150 659 491
test108_52000 1909.31 1253 640 613
test82_66000 1907.40 1231 709 522
test81_70000 1902.44 1173 655 518
test79_80000 1898.81 1199 655 544
test81_50000 1897.87 1245 610 635
test74_96000 1891.54 1144 561 583
test81_86000 1890.81 1163 706 457
test74_90000 1890.67 1307 672 635
test82_54000 1887.89 1226 649 577
test81_64000 1886.80 1273 681 592
test108_74000 1884.05 1196 669 527
test79_70000 1877.15 1259 622 637
test81_56000 1875.80 1297 644 653
test108_66000 1875.50 1310 722 588
test108_92000 1871.81 1185 674 511
test74_86000 1867.27 1280 601 679
test79_72000 1866.03 1245 622 623
test108_64000 1864.82 1250 669 581
test108_82000 1854.92 1233 651 582
test74_84000 1851.93 1274 623 651
test108_70000 1851.73 1200 667 533
test74_78000 1846.95 1328 654 674
test82_56000 1845.53 1194 654 540
test79_62000 1845.49 1232 581 651
test79_66000 1845.18 1335 639 696
test82_46000 1842.65 1313 665 648
test81_58000 1840.26 1264 642 622
test108_50000 1838.68 1291 611 680
test81_54000 1838.38 1228 601 627
test74_94000 1836.91 1271 633 638
test74_72000 1828.08 1245 573 672
test74_82000 1827.93 1254 590 664
test74_74000 1826.76 1201 564 637
test81_46000 1826.67 1223 574 649
test79_84000 1823.97 1293 651 642
test79_64000 1820.93 1261 602 659
test74_76000 1811.27 1246 595 651
test82_44000 1804.88 1264 628 636
test79_68000 1801.79 1239 608 631
test82_42000 1796.45 1330 648 682
test74_68000 1795.57 1184 557 627
test79_74000 1791.02 1226 596 630
test108_38000 1780.33 1137 532 605
test81_52000 1779.02 1260 611 649
test108_42000 1778.14 1242 584 658
test81_48000 1771.41 1244 581 663
test82_40000 1769.89 1195 579 616
test74_70000 1767.51 1225 570 655
test82_38000 1763.59 1231 578 653
test108_48000 1749.47 1289 605 684
test82_36000 1748.17 1249 571 678
test79_60000 1742.67 1259 588 671
test108_46000 1741.16 1248 606 642
test74_88000 1737.03 1293 619 674
test74_64000 1723.97 1164 537 627
test79_56000 1719.80 1181 550 631
test108_36000 1718.90 1201 577 624
test81_42000 1718.68 1250 577 673
test81_40000 1715.02 1173 546 627
test74_62000 1714.51 1142 540 602
test82_28000 1706.40 1148 554 594
test79_58000 1704.23 1301 600 701
test74_80000 1697.71 1280 576 704
test79_50000 1693.21 1187 565 622
test108_44000 1688.28 1169 542 627
test82_32000 1678.34 1235 570 665
test74_58000 1672.62 1141 547 594
test81_44000 1671.94 1251 584 667
test108_40000 1662.73 1236 577 659
test74_66000 1649.64 1192 548 644
test81_38000 1646.07 1117 525 592
test108_32000 1645.16 1175 563 612
test82_34000 1643.39 1191 552 639
test79_52000 1634.91 1147 553 594
test74_60000 1624.53 1190 573 617
test81_36000 1623.73 1224 586 638
test82_30000 1619.32 1228 576 652
test79_54000 1614.98 1189 551 638
test74_50000 1596.89 1105 527 578
test79_46000 1594.13 1162 555 607
test82_26000 1564.28 1117 532 585
test74_56000 1560.25 1187 574 613
test81_30000 1551.29 1173 575 598
test79_42000 1546.43 1184 568 616
test79_48000 1546.29 1127 534 593
test108_30000 1535.95 1160 566 594
test81_32000 1535.16 1125 540 585
test74_54000 1527.41 1216 584 632
test74_46000 1525.23 1144 554 590
test79_44000 1521.92 1121 534 587
test108_34000 1503.70 1149 534 615
test82_24000 1502.35 1194 561 633
test74_52000 1500.28 1166 557 609
test81_34000 1499.86 1149 537 612
test108_28000 1478.52 1176 554 622
test82_22000 1470.08 1188 574 614
test74_44000 1468.62 1133 531 602
test79_40000 1452.46 1168 554 614
test74_48000 1444.76 1153 534 619
test79_38000 1440.23 1201 587 614
test74_42000 1438.13 1129 544 585
test108_24000 1435.49 1149 547 602
test108_26000 1433.90 1140 542 598
test74_36000 1418.27 1211 582 629
test82_20000 1415.85 1107 528 579
test81_24000 1405.46 1169 561 608
test81_28000 1405.06 1202 574 628
test81_26000 1389.59 1156 545 611
test74_40000 1370.82 1111 535 576
test82_18000 1348.78 1161 551 610
test79_36000 1347.96 1173 550 623
test79_32000 1343.32 1164 565 599
test79_34000 1320.36 1160 561 599
test74_38000 1313.52 1193 572 621
test81_22000 1298.99 1156 556 600
test81_20000 1296.11 1178 576 602
test79_30000 1287.11 1147 562 585
test108_20000 1282.90 1161 554 607
test108_22000 1262.60 1167 548 619
test74_34000 1188.00 1174 559 615
test81_18000 1183.22 1197 582 615
test82_16000 1155.73 1214 588 626
test108_18000 1154.46 1275 605 670
test79_28000 1141.90 1209 576 633
test74_32000 1126.13 1217 576 641
test79_26000 1111.16 1153 545 608
test81_16000 1107.89 1229 590 639
test82_12000 1105.65 1144 535 609
test74_28000 1089.89 1194 572 622
test74_30000 1087.55 1193 574 619
test74_22000 1073.84 1143 535 608
test74_24000 1070.83 1122 531 591
test74_18000 1058.21 1170 556 614
test79_22000 1046.50 1218 574 644
test79_24000 1043.47 1168 557 611
test108_16000 1016.66 1257 591 666
test74_20000 1009.19 1206 556 650
test82_14000 979.31 1205 560 645
test81_14000 975.03 1171 551 620
test74_26000 963.16 1227 580 647
test79_20000 947.95 1206 557 649
test108_14000 900.09 1181 544 637
test81_12000 865.48 1218 559 659
test79_14000 857.64 1153 535 618
test74_12000 846.51 1227 555 672
test82_10000 845.35 1243 577 666
test79_18000 823.39 1158 522 636
test74_16000 780.49 1206 554 652
test79_16000 777.31 1140 516 624
test108_12000 775.14 1193 539 654
test108_10000 773.26 1153 527 626
test74_14000 767.17 1175 542 633
test81_10000 761.53 1138 521 617
test82_8000 758.25 1166 530 636
test74_10000 678.22 1241 551 690
test108_8000 638.40 1118 520 598
test79_12000 605.10 1107 505 602
test79_10000 564.44 1171 517 654
test108_6000 536.71 1172 516 656
test82_6000 528.11 1123 496 627
test81_6000 487.09 1124 525 599
test81_8000 472.62 1137 491 646
test74_8000 469.74 1130 490 640
test74_6000 467.44 1167 525 642
test79_8000 454.69 1113 506 607
test74_4000 294.72 1080 481 599
test81_4000 273.22 1150 511 639
test79_6000 261.63 1137 508 629
test108_4000 245.61 1227 557 670
test82_4000 219.05 1155 518 637
test108_2000 203.48 1167 496 671
test82_2000 198.43 1207 525 682
test74_2000 66.97 1169 486 683
test79_2000 30.87 1172 504 668
test79_4000 23.22 1105 455 650
test81_2000 0.05 1185 526 659
test74_0 -76.59 1146 443 703
test79_0 -146.26 1126 432 694
test81_0 -147.01 1113 440 673
test108_0 -205.68 1148 445 703
test82_0 -251.92 1141 445 696
/share/backup_data/go9/test_1/off_models/go9_iter_420000.cambricon1965.89 108 85 23
/share/backup_data/go9/test_1/off_models/go9_iter_380000.cambricon1881.05 115 88 27
/share/backup_data/go9/test_1/off_models/go9_iter_440000.cambricon1871.61 108 82 26
/share/backup_data/go9/test_1/off_models/go9_iter_360000.cambricon1866.61 101 77 24
/share/backup_data/go9/test_1/off_models/go9_iter_390000.cambricon1832.81 85 67 18
/share/backup_data/go9/test_1/off_models/go9_iter_370000.cambricon1824.77 86 66 20
/share/backup_data/go9/test_1/off_models/go9_iter_350000.cambricon1814.38 102 73 29
/share/backup_data/go9/test_1/off_models/go9_iter_310000.cambricon1786.49 97 71 26
/share/backup_data/go9/test_1/off_models/go9_iter_200000.cambricon1784.40 97 70 27
/share/backup_data/go9/test_1/off_models/go9_iter_340000.cambricon1781.18 104 79 25
/share/backup_data/go9/test_1/off_models/go9_iter_330000.cambricon1779.90 97 69 28
/share/backup_data/go9/test_1/off_models/go9_iter_190000.cambricon1768.35 99 67 32
/share/backup_data/go9/test_1/off_models/go9_iter_430000.cambricon1766.94 97 71 26
/share/backup_data/go9/test_1/off_models/go9_iter_400000.cambricon1753.95 118 81 37
/share/backup_data/go9/test_1/off_models/go9_iter_410000.cambricon1744.38 83 62 21
/share/backup_data/go9/test_1/off_models/go9_iter_160000.cambricon1743.27 103 68 35
/share/backup_data/go9/test_1/off_models/go9_iter_220000.cambricon1738.72 106 69 37
/share/backup_data/go9/test_1/off_models/go9_iter_280000.cambricon1727.67 99 65 34
/share/backup_data/go9/test_1/off_models/go9_iter_260000.cambricon1720.97 93 61 32
/share/backup_data/go9/test_1/off_models/go9_iter_210000.cambricon1708.78 110 69 41
/share/backup_data/go9/test_1/off_models/go9_iter_270000.cambricon1706.00 101 64 37
/share/backup_data/go9/test_1/off_models/go9_iter_240000.cambricon1695.03 106 68 38
/share/backup_data/go9/test_1/off_models/go9_iter_230000.cambricon1694.36 96 62 34
/share/backup_data/go9/test_1/off_models/go9_iter_450000.cambricon1690.93 98 62 36
/share/backup_data/go9/test_1/off_models/go9_iter_290000.cambricon1684.90 88 56 32
/share/backup_data/go9/test_1/off_models/go9_iter_180000.cambricon1682.11 91 58 33
/share/backup_data/go9/test_1/off_models/go9_iter_150000.cambricon1679.98 96 57 39
/share/backup_data/go9/test_1/off_models/go9_iter_300000.cambricon1669.36 105 71 34
/share/backup_data/go9/test_1/off_models/go9_iter_140000.cambricon1645.23 105 64 41
/share/backup_data/go9/test_1/off_models/go9_iter_320000.cambricon1640.42 100 63 37
/share/backup_data/go9/test_1/off_models/go9_iter_250000.cambricon1624.16 122 69 53
/share/backup_data/go9/test_1/off_models/go9_iter_170000.cambricon1616.76 100 48 52
/share/backup_data/go9/test_0/off_models/go9_iter_280000.cambricon1611.13 110 60 50
/share/backup_data/go9/test_0/off_models/go9_iter_270000.cambricon1603.77 103 58 45
/share/backup_data/go9/test_1/off_models/go9_iter_100000.cambricon1569.67 103 56 47
/share/backup_data/go9/test_1/off_models/go9_iter_130000.cambricon1568.74 108 60 48
/share/backup_data/go9/test_0/off_models/go9_iter_250000.cambricon1568.40 115 56 59
/share/backup_data/go9/test_1/off_models/go9_iter_90000.cambricon1565.57 90 51 39
/share/backup_data/go9/test_1/off_models/go9_iter_110000.cambricon1564.26 98 51 47
/share/backup_data/go9/test_0/off_models/go9_iter_260000.cambricon1550.19 100 53 47
/share/backup_data/go9/test_0/off_models/go9_iter_290000.cambricon1537.28 102 48 54
/share/backup_data/go9/test_0/off_models/go9_iter_300000.cambricon1507.50 106 54 52
/share/backup_data/go9/test_1/off_models/go9_iter_120000.cambricon1492.67 102 51 51
/share/backup_data/go9/test_0/off_models/go9_iter_220000.cambricon1489.70 113 53 60
/share/backup_data/go9/test_0/off_models/go9_iter_230000.cambricon1489.06 97 51 46
/share/backup_data/go9/test_0/off_models/go9_iter_240000.cambricon1487.05 105 49 56
/share/backup_data/go9/test_0/off_models/go9_iter_310000.cambricon1485.16 122 59 63
/share/backup_data/go9/test_1/off_models/go9_iter_80000.cambricon1482.38 121 62 59
/share/backup_data/go9/test_0/off_models/go9_iter_210000.cambricon1449.58 114 52 62
/share/backup_data/go9/test_0/off_models/go9_iter_200000.cambricon1431.02 117 53 64
/share/backup_data/go9/test_0/off_models/go9_iter_180000.cambricon1393.59 99 41 58
/share/backup_data/go9/test_1/off_models/go9_iter_70000.cambricon1391.47 97 40 57
/share/backup_data/go9/test_1/off_models/go9_iter_60000.cambricon1381.80 109 44 65
/share/backup_data/go9/test_0/off_models/go9_iter_160000.cambricon1368.04 95 36 59
/share/backup_data/go9/test_0/off_models/go9_iter_120000.cambricon1365.11 105 40 65
/share/backup_data/go9/test_0/off_models/go9_iter_140000.cambricon1363.83 98 40 58
/share/backup_data/go9/test_0/off_models/go9_iter_150000.cambricon1362.46 95 41 54
/share/backup_data/go9/test_0/off_models/go9_iter_190000.cambricon1362.30 101 39 62
/share/backup_data/go9/test_0/off_models/go9_iter_110000.cambricon1358.60 101 39 62
/share/backup_data/go9/test_0/off_models/go9_iter_170000.cambricon1347.82 116 44 72
/share/backup_data/go9/test_0/off_models/go9_iter_80000.cambricon1316.20 103 40 63
/share/backup_data/go9/test_0/off_models/go9_iter_130000.cambricon1312.80 91 31 60
/share/backup_data/go9/test_1/off_models/go9_iter_50000.cambricon1249.41 120 43 77
/share/backup_data/go9/test_0/off_models/go9_iter_100000.cambricon1246.38 109 34 75
/share/backup_data/go9/test_0/off_models/go9_iter_90000.cambricon1224.54 96 30 66
/share/backup_data/go9/test_0/off_models/go9_iter_70000.cambricon1199.53 90 28 62
/share/backup_data/go9/test_1/off_models/go9_iter_40000.cambricon1194.55 110 36 74
/share/backup_data/go9/test_1/off_models/go9_iter_20000.cambricon1188.10 99 26 73
/share/backup_data/go9/test_0/off_models/go9_iter_50000.cambricon1163.52 109 31 78
/share/backup_data/go9/test_1/off_models/go9_iter_30000.cambricon1162.82 114 32 82
/share/backup_data/go9/test_0/off_models/go9_iter_60000.cambricon1117.88 99 22 77
/share/backup_data/go9/test_0/off_models/go9_iter_40000.cambricon1078.34 94 21 73
/share/backup_data/go9/test_1/off_models/go9_iter_10000.cambricon1005.57 103 17 86
/share/backup_data/go9/test_0/off_models/go9_iter_30000.cambricon983.10 110 19 91
/share/backup_data/go9/test_0/off_models/go9_iter_20000.cambricon975.82 99 13 86
/share/backup_data/go9/test_0/off_models/go9_iter_10000.cambricon896.87 103 9 94
/share/backup_data/go9/test_0/off_models/go9_iter_0.cambricon831.48 95 3 92
/share/backup_data/go9/test_1/off_models/go9_iter_0.cambricon813.59 98 2 96
config_0: /share/elo-rating/etc/9_pk_offline_1.4.0.conf
config_1: /share/elo-rating/etc/9_pk_offline_1.4.0.conf
model_0: /share/elo-rating/models/test79_2000
model_1: /share/elo-rating/models/test79_0
cpuct_0: 1.5
cpuct_1: 1.5
eval_num_0: 15526
eval_num_1: 15337
0
config_p1_eval: /share/alphazero-general/go9/etc/pk_p1_eval.conf
config_p1_mcts: /share/alphazero-general/go9/etc/pk_p1_mcts.conf
config_p2_eval: /share/alphazero-general/go9/etc/pk_p2_eval.conf
config_p2_mcts: /share/alphazero-general/go9/etc/pk_p2_mcts.conf
model_p1: /share/backup_data/go9/test_1/off_models/go9_iter_160000.cambricon
model_p2: /share/backup_data/go9/test_0/off_models/go9_iter_260000.cambricon
P2 win rat
\ No newline at end of file
ulimit -c 0
pip install zmq
# pip install zmq
apt-get update
apt-get install -y python-zmq
cd /share/elo-rating
./ELO_client_test.py 0 & ./ELO_client_test.py 1 & ./ELO_client_test.py 2 & ./ELO_client_test.py 3
# ./ELO_client.py 0 & ./ELO_client.py 1 & ./ELO_client.py 2 & ./ELO_client.py 3
cd /share/elo-rating
python ELO_server_test.py
#python ELO_server.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment