Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add skip (hidden) option #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions lc0_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
hasOpenCL bool
hasBlas bool
testedCudnnFp16 bool
skippedGames int

hostname = flag.String("hostname", "http://api.lczero.org", "Address of the server")
user = flag.String("user", "", "Username")
Expand All @@ -59,6 +60,7 @@ var (
keep = flag.Bool("keep", false, "Do not delete old network files")
version = flag.Bool("version", false, "Print version and exit.")
trainOnly = flag.Bool("train-only", false, "Do not play match games")
skip = flag.Int("skip", 0, "")
)

// Settings holds username and password.
Expand Down Expand Up @@ -656,6 +658,16 @@ func train(httpClient *http.Client, ngr client.NextGameResponse,
break
}
testedCudnnFp16 = true
skippedGames++
if skippedGames <= *skip {
fmt.Printf("Skipping game %d of %d\n", skippedGames, *skip)
err := os.Remove(gi.fname)
if err != nil {
log.Printf("Failed to remove training file: %v", err)
}
continue
}
skippedGames = 0
fmt.Printf("Uploading game: %d\n", numGames)
numGames++
progressOrKill = true
Expand Down Expand Up @@ -964,10 +976,10 @@ func testEP() {
}
}

func hideLc0argsFlag() {
func hideFlags() {
shown := new(flag.FlagSet)
flag.VisitAll(func(f *flag.Flag) {
if f.Name != "lc0args" {
if f.Name != "lc0args" && f.Name != "skip" {
shown.Var(f.Value, f.Name, f.Usage)
}
})
Expand Down Expand Up @@ -995,7 +1007,7 @@ func main() {

testEP()

hideLc0argsFlag()
hideFlags()
flag.Parse()

if *version {
Expand Down