I don't know what you mean by "contextual", but validity, as you yourself stated above, simply means "logical".
Ad hominem arguments are logical fallacies and are not valid. Period. And because logic is not something used only in debates, formal or otherwise, ad hominem arguments are not valid...